Guys, this is obviously just a dumb error but my brain is too tired to see it now.
Getting this when submitting:
Form.html looks like this:
and contactformhandler1.php looks like this
I know, I know, there's probably slicker ways of doing this, but just getting a handle on the basics.
What's wrong here?
Getting this when submitting:
Parse error: syntax error, unexpected T_STRING in /var/sites/b/blackhawkuav.co.uk/public_html/ContactFormHandler1.php on line 31
Form.html looks like this:
PHP:
<form action="ContactFormHandler1.php" method="post">
<table>
<tr>
<td>
Your Name:
</td>
<td>
<input type="text" id="Name" name="Name" />
</td>
</tr>
<tr>
<td>
Your Email:
</td>
<td>
<input type="text" id="Email" name="Email" />
</td>
</tr>
<tr>
<td>
Your Phone:
</td>
<td>
<input type="text" id="Phone" name="Phone">
</td>
</tr>
<tr>
<td>
Your Message:
</td>
<td>
<input type="textarea" id="Message" name="Message">
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<input type="submit" id="submit" value="Contact Me!" />
<input type="reset" id="reset" value="Start Over!" />
</td>
</tr>
</table>
</form>
and contactformhandler1.php looks like this
PHP:
<?php
// Grab our POSTed form values
$contactName = $_POST["Name"];
$contactEmail = $_POST["Email"];
$contactPhone = $_POST["Phone"];
$contactMessage = $_POST["Message"];
// Connect to our DB with mysql_connect
$sql_connection = mysql_connect("localhost", "root", "root");
mysql_select_db("contacts_db", $sql_connection);
$sql = "INSERT INTO contacts (
ContactName,
ContactEmail,
ContactPhone,
ContactMessage,
ContactDate
)
VALUES (
'$contactName',
'$contactEmail',
'$contactPhone',
'$contactMessage',
NOW()
)"
mysql_query($sql, $sql_connection);
mysql_close($sql_connection);
?>
I know, I know, there's probably slicker ways of doing this, but just getting a handle on the basics.
What's wrong here?