please can someone help me with this php code. I am new to using php and do not understand it completly. We are using a online registration form for new users. The form should process the customers details and forwared by email the details back to use. At the moment I keep getting the parse code error.
Link:
http://www.foneandsurf.com/acatalog/register.html (view source)
php return code:
<table width="100%" border="0" cellspacing="0" cellpadding="3" height="100%">
<tr>
<td align="center" valign="middle">
<?php
// Set up the email message header
//
//$message = "Thank you for using our on-line form.\n";
$message .= "OnLine User Registration Form -\n";
if ($name) // Check for first Name input
{
$name = "Full Name - $name"; // Create a line for the email message
$message .= "$name\n"; // Add it to the message
}
else
{
$error = "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"#FF0000\">Full name</font><br>\n" ; // Error if no Name input
}
if ($email) // Check last name input
{
$emai = "Email - $email"; // Create a line for the email message
$message .= "$email\n"; // Add it to the message
}
else
{
$error .= "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"#FF0000\">Email</font><br>\n" ; // Add to Error if missing
}
if ($company name) // Check for Company Name input
{
$company name = "Company Name - $company name"; // Create a line for the email message
$message .= "$company name\n"; // Add it to the message
}
else
{
$error .= "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"#FF0000\">Company Name</font><br>\n" ; // Add to Error if missing
}
if ($address // Check for Address input
{
$address = "Address - $address"; // Create a line for the email message
$message .= "$address\n"; // Add it to the message
}
else
{
$error .= "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"#FF0000\">Address</font><br>\n" ; // Add to Error if missing
}
if ($contact telephone no.) // Check for Contact Telephone No. input
{
$contact telephone no. = "Contact Telephone No. - $contact telephone no."; // Create a line for the email message
$message .= "$Contact Telephone No.\n"; // Add it to the message
}
else
{
$error .= "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"#FF0000\">Contact Telephone No.</font><br>\n" ; // Add to Error if missing
}
if ($fax no.) // Check for Fax No. input
{
$fax no. = "Fax No. - $fax no."; // Create a line for the email message
$message .= "$fax no.\n"; // Add it to the message
}
else
{
$error .= "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"#FF0000\">Fax No.</font><br>\n" ; // Add to Error if missing
}
if ($preffered user name) // Check for Preffered User Name input
{
$preffered user name = "Preffered User Name - $preffered user name"; // Create a line for the email message
$message .= "$preffered user name\n"; // Add it to the message
}
else
{
$error .= "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"#FF0000\">Preffered User Name</font><br>\n" ; // Add to Error if missing
}
if ($preffered passward) // Check for Preffered Passward input
{
$preffered passward = "Preffered Passward - $preffered passward"; // Create a line for the email message
$message .= "$preffered passward\n"; // Add it to the message
}
else
{
$error .= "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"#FF0000\">Preffered Passward</font><br>\n" ; // Add to Error if missing
}
if ($re-enter preffered passward) // Check for Re-enter Preffered Passward input
{
$re-enter preffered passward = "Re-enter Preffered Passward - $re-enter preffered passward"; // Create a line for the email message
$message .= "$re-enter preffered passward\n"; // Add it to the message
}
else
{
$error .= "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"#FF0000\">Re-enter Preffered Passward</font><br>\n" ; // Add to Error if missing
}
if ($comments) // Check for Comments input
{
$comments = "Comments - $comments"; // Create a line for the email message
$message .= "$comments\n"; // Add it to the message
}
else
{
$error .= "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"#FF0000\">Comments</font><br>\n" ; // Add to Error if missing
}
// Email a copy of the message to person completing the form
if ($error == "") // If Error contains nothing, display a message
{ // and send the email
echo "<br><br><br>Thank you for using our on-line form.";
// <br><br>A copy of your Inquiry has been emailed to you at
// print($uemail);
// echo "<br><br>Thank you.";
// Substitute YOUR NAME and your@email.address with your name and your email address
// so that the form filler knows what the email is all about just by reading the headers.
// DO NOT remove the < > brackets
// ######### mail("$uemail", "Your Form details", $message, "From: FoneandSurf <your@email.address>");
// Substitute your@email.address with your email address - DO NOT remove any quote marks
// This is the bit that sends YOU the contents of the form
mail("info@foneandsurf.com.com", "FoneandSurf USER Registration", $message, "From: $email");
mail("fone@foneandsurf.com", "FoneandSurf USER Registration", $message, "From: $email");
mail("hishamysally@hotmail.com", "FoneandSurf USER Registration", $message, "From: $email");
}
else // If Error does contain something, display a message
{ // and tell the user what's wrong.
print "<img src=\"http://www.foneandsurf.com/acatalog/sorry.gif\" border=\"0\"><br> \n";
//print "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"#0000FF\">Sorry, you have not completed the following, </font> \n";
//print "<font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#000000\">Which are mandatory</font><font face=\"Arial, Helvetica, sans-serif\" size=\"1\" color=\"#FF0000\">*</font><br>\n";
print "$error<br>\n";
print "<br>\n";
print "<br>\n";
print "<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"#0000FF\">To make the changers click the \"Back\" button on your browser bar.</font><br>\n";
}
?>
</td>
</tr>
</table>
ERROR SHOWN: Parse error: parse error in /home/sites/site1/web/acatalog/RegisterForm.php on line 465
Thanks any help would by very much appreciated. Please send any replies to fone@foneandsurf.com