Ho questo codice:
ma mi da questo errore subito:codice:html> <body> <?php if ($_POST['submit']) { $required_fields = explode(",", $_POST['required']); $error = 0; foreach($required_fields as $fieldname) { if ($_POST[$fieldname] == "") { $error++; } } if ($error == 0) { if (strstr($_POST['email'], "@") and strstr($_POST['email'], ".")) { mail("youremail@your.com" , "Message from Web Form", $_POST['message'], "From: $_POST[name] <$_POST[email]>"); print "<html><body>Thank you for submitting your comments $_POST[name]!</body></html>"; exit; } else { $errormessage = "The email address you entered does not appear to be valid "; } } else { $errormessage = "[b]You have left some required fields in the form blank! Please fill in the form completely."; } } ?> <?=$errormessage?> <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> <table width="500" border="0" cellpadding="5" cellspacing="0"> <tr><td>Your name:</td><td><input type="text" name="name" value="<?=$_POST['name']?>"></td></tr> <tr><td>Your email:</td><td><input type="text" name="email" value="<?=$_POST['email']?>"><td><tr> <tr><td>Your message:</td><td><textarea name="message"><?=$_POST['message']?></textarea></td></tr></table> <input type="hidden" name="required" value="name,email,message"> <input type="submit" name="submit" value="submit"> </body></html>
Notice: Undefined index: submit in c:\inetpub\wwwroot\php\mail.php on line 6
Notice: Undefined variable: errormessage in c:\inetpub\wwwroot\php\mail.php on line 35
e lo stesso all interno degli input come value.
Dove sbaglio?

Rispondi quotando
