I searched every thread on these formus but didn’t find any info that I need.
I have a php form and I need to be able after submitting to display success text in the same window is it possible?
<?php
if(isset($_POST['submit'])) {
$to = "blah@blah.com";
$subject = "web form";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$body = "From: $name_field
E-Mail: $email_field
Message:
$message";
if (!eregi ('^[[:alnum:]][a-z0-9_\.\-]*@[a-z0-9\.\-]+\.[a-z]{2,4}$', stripslashes(trim($_POST['email']))))
{
echo 'error!! try again';
exit;
}
$headers = "From: $email";
mail($to, $subject, $message, $headers);
echo "message sent: $to!";
mail($to, $subject, $body);
} else {
echo "wrong email address, check the email and try again!";
}
?>
so for errors and success I’d like to be able to display information in the same page without opening a new window. of ocourse if this can be done