Hi,
I posted this already on another thread but I'll start my own just incase...
I have an html contact form that I'm trying to create a working php script for.
I'm having a few difficulties... partly because I'm very new at this... well mostly because of that!
When I try to submit the contact form I get this error...
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home8/zomglawl/public_html/ericgruber.net/mailer.php on line 9
Parse error: syntax error, unexpected T_IF in /home8/zomglawl/public_html/ericgruber.net/mailer.php on line 10
Please be gentle because this is all new to me...
Here's the script...
<?php
if(isset($_POST["submit"])) {
$to = "you@yourdomain.net";
$subject = "Contact from website";
$name_field = $_POST[ "name"];
$email_field = $_POST[ "email"];
$city_field = $_POST[ "city"];
$state_field = $_POST[ "state"];
$phone_field = $_POST[ "phone"];
$message = $_POST[ "message"];
$body = "From: $name_field \n
E-Mail: $email_field \n
City: $city_field \n
State: $state_field \n
Phone: $phone_field \n
Message: Message: $message \n
";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>
Here's my html form...
<form method="post" action="mailer.php">
<table style="margin-bottom: 0pt;" cellspacing="0">
<tbody>
<tr>
<td width="150">Name<span class="required"> *</span></td>
<td><input name="Name" type="text"></td>
</tr>
<tr>
<td>Email<span class="required"> *</span></td>
<td><input name="Email" type="text"></td>
</tr>
<tr>
<td>City</td>
<td><input name="City" type="text"></td>
</tr>
<tr>
<td>State</td>
<td><input name="State" type="text"></td>
</tr>
<tr>
<td>Phone<span class="required"> *</span></td>
<td><input name="Phone" size="12"
maxlength="12" type="text"></td>
</tr>
<tr>
<td>Comment<span class="required"> *<br>
<br>
<br>
<br>
<br>
</span></td>
<td><textarea name="Comment" cols="40"
rows="6"></textarea></td>
</tr>
<tr>
<td><input name="Submit" value="Submit"
type="submit"></td>
<td> </td>
</tr>
</tbody>
</table>
</form>
Thank you...