I am trying to add a simple contact form to the front page of my website www.gkicredit.com . The form shows up as I would want (aside from the font being black when I want it to be white!) but when you click submit you get an error " Parse error: syntax error, unexpected $end in /home/bsc/public_html/GKICREDIT.COM/send_contactnew.php on line 31"! I will list my php code for both the form and the send_contact.php file (submit button).
My goal is to make this work any way possible! Thanks in advance!
FORM on Home.php:
PHP Code:
<table width="400" border="0" align="center" cellpadding="3" cellspacing="1"> <tr> <td><strong>Contact Form </strong></td> </tr> </table>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td><form method="post" action="send_contactnew.php"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td width="16%">Full Name</td> <td width="2%">:</td> <td width="82%"><input name="name" type="text" id="name" size="50"></td> </tr> <tr> <td>City, State</td> <td>:</td> <td><input name="location" type="text" id="location" size="50"></td> </tr> <tr> <td>Phone Number</td> <td>:</td> <td><input name="phone" type="text" id="phone" size="50"></td> </tr> <tr> <td>Email</td> <td>:</td> <td><input name="customer_mail" type="text" id="customer_mail" size="50"></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Submit"> </td> </tr> </table> </form> </td> </tr> </table>
send_contactnew.php
PHP Code:
<?php if($_POST['Submit']) {
//COLLECT DATA $name = $_POST['name']; $location = $_POST['location']; $phone = $_POST['phone']; $customer_mail = $_POST['customer_mail'];
//ERROR CHECKING $error = '';
if (!$name) $error = $error."<b>Full Name</b>"; if (!$location) $error = $error."<b>City, State</b>"; if (!$phone) $error = $error."<b>Phone Number</b>"; if (!$customer_mail) $error = $error."<b>Email Address</b>";
if ($error!="") echo "<font color='#FF0000'><font size='4'>Please fill out all required fields</font><br />$error</font>"; else { //SUBMIT & REDIRECT mail( "virtuouse@gmail.com", "Contact Form Results", $emailMessage, "$name <$email>" ); header( "Location: http://gkicredit.com/thankyou.php" );
?>
The goal here is to have all the information placed in the form (Name, city state, phone number, and email) to be sent in an email to virtuouse@gmail.com or whatever I put as the email there. If any other info is needed please feel free to ask! I've been stuck on this for over a week now!
Last edited by eharpaz; 01-29-2010 at 08:26 PM..
|