This code is somewhat long, but it is an RSVP form that validates information and sends the info to an email address. When ever the form is submitted I get a error saying: Parse error: parse error, expecting ','' or';'' in C:\Inetpub\wwwroot\form.php on line 74
Please help if you can ...
<head></head>
<body>
<font color="red"> Fields are required</font>
<form name="lunch_reservation_form" method="post" action="confirmation.php">
<p><font color="red"><sup></sup></font> First Name:
<input type="text" name="first_name" size="15" maxlength="100">
<font color="red"><sup></sup></font> Last Name:
<input type="text" name="last_name" size="15" maxlength="100">
</p>
<p><font color="red"><sup></sup></font> Your Email:
<input type="text" name="email" size="30" maxlength="100">
</p>
<p>Company Name:
<input type="text" name="company_name" size="30" maxlength="100"><br>
Company Title:
<input type="text" name="company_title" size="30" maxlength="100">
</p>
<p><font color="red"><sup></sup></font> Address 1:
<input type="text" name="address1" size="30" maxlength="100"><br>
Address 2:
<input type="text" name="address2" size="30" maxlength="100">
</p>
<p><font color="red"><sup></sup></font> City:
<input type="text" name="city" size="15" mazlength="30">
<font color="red"><sup></sup></font> State:
<input type="text" name="state" size="2">
<font color="red"><sup></sup></font> Zip Code:
<input type="text" name="zip" size="5" maxlength="12">
</p>
<p><font color="red"><sup>*</sup></font> Phone Number:
<input type="text" name="phone" size="15" maxlength="30">
</p>
<p>Fax Number:
<input type="text" name="fax" size="15" maxlength="30">
</p><b>Please check all that apply:</b><br>
<input name="evangelist" type="checkbox"> I am interested in receiving information about becoming an <i>Evangilist</i> member.<br>
<input name="company_sponsor" type="checkbox"> I am interested in receiving information about company sponsorship. (Company sponsors offer free <i>Evangelist</i> memberships)<br>
<input name="email_list" type="checkbox"> I would like to be signed up for TechAlliance email list so I am invited to future events.
<p>
<input type="submit" name="submit" value="Submit">
<input type="reset" name="reset" value="Clear Form">
</p>
</form>
<?php
$space = " "
if (($first_name == "") || ($last_name == "") || ($email == "") || ($address1 == "") || ($city == "") || ($state == "") || ($zip == "") || ($phone == ""))
{
echo "<form name=lunch_reservation_form method=post action=confirmation.php>";
echo "<p>Error: All fields have not been filled</p>";
echo "<p>Please fill in all reguired fields ... they are listed below.</p>";
}
if ($first_name == "")
{
echo "<p>First Name<br><input type=text name=first_name></p>";
}
else
{
echo "<input type=hidden name=first_name value=$first_name>";
}
if ($last_name == "")
{
echo "<p>Last Name<br><input type=text name=last_name></p>";
}
else
{
echo "<input type=hidden name=last_name value=$last_name>";
}
if ($email == "")
{
echo "<p>Your Email<br><input type=text name=email></p>";
}
else
{
echo "<input type=hidden name=Email value=$email>";
}
if ($address1 == "")
{
echo "<p>Your Email<br><input type=text name=address1></p>";
}
else
{
echo "<input type=hidden name=Email value=$address1>";
}
if ($city == "")
{
echo "<p>Your Email<br><input type=text name=city></p>";
}
else
{
echo "<input type=hidden name=Email value=$city>";
}
if ($state == "")
{
echo "<p>Your Email<br><input type=text name=state></p>";
}
else
{
echo "<input type=hidden name=Email value=$state>";
}
if ($zip == "")
{
echo "<p>Your Email<br><input type=text name=zip></p>";
}
else
{
echo "<input type=hidden name=Email value=$zip>";
}
if ($phone == "")
{
echo "<p>Your Email<br><input type=text name=phone></p>";
}
else
{
echo "<input type=hidden name=Email value=$phone>";
}
if (($first_name == "") || ($last_name == "") || ($email == "") || ($address1 == "") || ($city == "") || ($state == "") || ($zip == "") || ($phone == ""))
{
echo "<input type=submit name=submit value=Submit>";
echo "<input type=reset name=reset value=Clear Form>";
echo "</form>";
}
else
{
$message = "Name: $first_name . $space . $last_name\nEmail: $email\nCompany Name: $company_name\nCompany Title: $company_title\nAddress 1: $address1\nAddress 2: $address2\nCity: $city\nState: $state\nZip Code: $zip\nPhone Number: $phone\nFax Number: $fax\n$evangelist - I am interested in receiving information about becoming an <i>Evangilist</i> member.\n$company_sponsor - I am interested in receiving information about company sponsorship. (Company sponsors offer free <i>Evangelist</i> memberships)\n$email_list - I would like to be signed up for TechAlliance email list so I am invited to future events.";
$extra = "From: $first_name $last_name\r\nReply-To: $email\r\n";
mail ("gammon@newnevada.com", "Website Email", $message, $extra);
echo "<p>Thanks for your inguiry, $first_name . $space . $last_name.</p>";
echo "<p>The TechAlliance will validate your information and confirm your reservation via email.</p>";
}
?>
</body>