Posted: Sun Sep 09, 2007 7:11 pm Form Question (from a real newbe)
Hi
Hope someone might be able to help me with a simple form i am looking to run.
The form is in HTML format but is processed through a PHP script
See :
<?php
// initialize a variable to
// put any errors we encounter into an array
$errors = array();
// check to see if a name was entered
if (!$_POST['EmailAddress'])
// if not, add that error to our array
$errors[] = "Email Addess is Required";
// check to see if a subject was entered
if (!$_POST['Name'])
// if not, add that error to our array
$errors[] = "Name is required";
// if there are any errors, display them
if (count($errors)>0){
echo "<strong>ERROR:<br>\n";
foreach($errors as $err)
echo "$err<br>\n";
} else {
// no errors, so we build our message
$recipient = xxxxxxxxxatxxxxxx.com';
$from = stripslashes($_POST['Name']);
$subject = stripslashes($_POST['Subject']);
$msg = "Message sent by $from\n
".stripslashes($_POST['MsgBody']);
if (mail($recipient,$subject,$msg))
echo "Thanks for your message we will be in contact with you shortly!";
else
echo "An unknown error occurred.";
}
?>
It works fine for what i need but i would like it to go to a new url once submitted .
Eg : press submit then it new page loaded with echo "Thanks for your message we will be in contact with you shortly!"; then redirect to a www.isellstuff.com
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum