Forum Moderators: coopster
I'm pretty new to PHP and I am trying to submit a form to itself. I used 'echo' to include any images so everything looks as it should (if someone has a better way to that, enlighten me).
I had loaded the page a few times and it looked/worked right, minus the bad validations I worked out. Now that specific page is not loading at all now, but when I navigate to contact.php, the internal server error shows up, but I get a blank email anyway. The script processed without the page even loading. Is there something I can do to load up the page, but not execute the script. Or is it possibly just the server problem?
if (ereg("^[[:alpha:]]+$", $name)) {
echo "Please enter your name.\n";
}
if (ereg("^([^@]+)@([a-z\-]+\.)+([a-z]{2,4})$", $email)) {
echo "Invalid email, please try again.\n";
}
if (ereg("^[[:alpha:]]+[[:digit:]]*$", $message)) {
echo "Please enter a message.";
?>
<html>
/*HTML*/
<form action="contactphp.php" method="post">
/*More HTML*/
</table></form></blockquote></td>
<?php
}
else {
mail("pvalure@example.com", "Contact Form Submission", $bodycontent, "From: example");
mail($email, "Auto-Reply", $autoreply, "From: example");
header("Location: http://www.example.com/thanks.html");
}
?>
i'm so new to this, any ideas?
[edited by: jatar_k at 2:06 pm (utc) on July 21, 2007]
[edit reason] please use example.com [/edit]