Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/10/2011, 00:59
marles
 
Fecha de Ingreso: octubre-2011
Ubicación: Girona
Mensajes: 4
Antigüedad: 12 años, 6 meses
Puntos: 0
Formulario PHP

Hola he hecho un formulario en PHP y en java... todo fuciona bien pero no sé porque de vez en cuando recibo e-mails vacíos cuando hay una obligación para escribir.
escribo el codigo para que me podáis decir donde he fallado. me haríais un favor muy grande!!
sludos
gracias

Envío PHP:

<?php
$to = "[email protected]";
$subject = "CAD transfer francia";
$msg = "CAD-transfer francia\n Un usuario solicita información o ha incluido algún comentario:\n";
$msg .= "Nombre: $_POST[nom]\n";
$msg .= "E-Mail: $_POST[email]\n";
$msg .= "Empresa: $_POST[societe]\n";
$error = array(00123,00124,00125,00126,00127,00234,00256);
$mailheaders = "Remitente: Usuario $_POST[nombre]\n";
mail($to, $subject, $msg, $mailheaders);
?>


Documento de vuelta html:

<script type="text/javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function MM_validateForm() { //v4.0
if (document.getElementById){
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmaill')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' falta la la direccion de correo.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' champ obligatoire.\n'; }
} if (errors) alert('formulaire incorrect:\n'+errors);
document.MM_returnValue = (errors == '');
} }
//-->
</script>
<div id="pagina">
<form action="envio-300-francia.php" method="post" name="contacto web" id="contacto web" onsubmit="MM_validateForm('nom','','R','email','', 'R','societe','','R');return document.MM_returnValue">
<p> Pr&eacute;nom et Nom <span class="obligatorio"> *</span>
<input name="nom" type="text" id="nom" size="32" maxlength="64" />
email <span class="obligatorio">*</span><br />
<input name="email" type="text" id="email" size="32" maxlength="64" />

<br />Soci&eacute;t&eacute;<span class="obligatorio">*</span><br />
<input name="societe" type="text" id="societe" size="32" maxlength="64" />
</p>
<p class="obligatorio"><em>*Champ obligatoire</em><br />
<br />
<input name="borrar" type="reset" class="boton" id="borrar" value="Effacer" />
&nbsp;
<input name="button" type="submit" id="button" value="Envoyer" />
</p>
</form>
</div>