Hello,
How can I direct users to a specific URL rather than have them see a message like "All fields are required!" or "Your email has been sent." What is the correct syntax? I made a formmail with the following PHP script:
<?php
// field validation
if ($email=="" || $message=="" || $name==""|| $subject=="")
{
print ("All fields are required! Please go back and try again.");
}
else {
// email validation
if(!eregi('^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,3})?)$', $email)) {
print ("Your email address does not appear to be valid. Please go back and try again.");
exit;
}
// send email
$to = "info@mysite.com";
$msg = "From: $name\n\n";
$msg .="Email: $email\n\n";
$msg .="Subject: $subject\n\n\n\n";
$msg .= "$message\n\n";
mail($to, $subject, $msg, "From: $name\nReply-To: $email\n");
print ("Thank you $name, your email has been sent.");
}
?>
Thank you. All help will be appreciated.
Sharez



Reply With Quote



Bookmarks