Please help with Simple form script and error
Posted: Wed May 27, 2009 4:26 pm
Hello All
I am having some issues with a simple form script. The script works fine in my testing server (Ipower) but when I move it to my site host (JustHost and Godaddy) this script no longer works.
I get this error Parse error: syntax error, unexpected T_IF in /home/inourow1/public_html/html/thanks.php on line 27
This is the form script
and this is the php script
its called by this code in the body of the thankyou.php page
here are links to the actual pages
broken form - http://www.inourownbackyard.us/html/join.html
working form - http://jessicamans.com/dev/ioob/html/join.html
please if anyone can help me, I will really appreciate it.
Kobus

I am having some issues with a simple form script. The script works fine in my testing server (Ipower) but when I move it to my site host (JustHost and Godaddy) this script no longer works.
I get this error Parse error: syntax error, unexpected T_IF in /home/inourow1/public_html/html/thanks.php on line 27
This is the form script
Code: Select all
<form action="thankyou.php" method="post">
<p>Name<br />
<input name="name" type="text" size="40">
</p>
<p> Email Address *<br>
<input name="emailaddress" type="text" size="40">
<br>
</p>
<p>Street<br>
<input name="streetname" type="text" size="40">
<br>
</p>
<p>City / State / Zip<br>
<input name="city" type="text" size="21">
<input name="state" type="text" size="5">
<input name="zip" type="text" size="10">
<br>
</p>
<p>Phone Number<br>
<input name="phonenumber" type="text" size="40">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
Code: Select all
<?PHP
global $_POST;
$name = $_POST["name"] ;
$emailaddress = $_POST["emailaddress"];
$streetname = $_POST["streetname"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip = $_POST["zip"];
$phonenumber = $_POST["phonenumber"];
$to = "tazzmans1977@gmail.com";
$subject = "In Our Own Backyeard Website Form Submission";
$headers = "From: $emailaddress\n";
$message = "A visitor to the In our own backyard site has filled out the following information.\n
Name: $name
Email Address: $emailaddress
Address: $streetname
City: $city
State: $state
Zip: $zip
Phone Number: $phonenumber";
if (preg_match(' /[\r\n,;\'"]/ ', $_POST['emailaddress'])) {
exit('Invalid Email Address');
}
else {
mail($to,$subject,$message,$headers);
}
?>
Code: Select all
<?php include("thanks.php"); ?>
broken form - http://www.inourownbackyard.us/html/join.html
working form - http://jessicamans.com/dev/ioob/html/join.html
please if anyone can help me, I will really appreciate it.
Kobus