i'm getting the following error from this php script and can't seem to find it any help?
Parse error: parse error, unexpected '<' in /homepages/6/d122159774/htdocs/stjohns/portal/register.php on line 79
<?php
/* Registration Script */
require ('mysql.php');
if (isset ($_POST['submit'])) { // Check to see if the form has been submitted
$username = $_POST['username'];
$password = md5 ($_POST['password']); // MD5 encrypt the password so it is more secure
$regkey = $_POST['regkey'];
// See if the key is valid
$sql = "SELECT * FROM reg_keys WHERE regkey='$regkey' LIMIT 1";
if ($r = mysql_query ($sql)) {
$num = mysql_num_rows ($r);
if ($num > 0) { // if there is a row with that key, the key is valid
// The key is valid, add user to the database
$add_sql = "INSERT INTO users (users_id, username, password, regkey) VALUES (0, '$username', '$password', '$regkey')";
// We make the first value (for users_id) 0 because it is set to auto increment,
// so the users_id will be assigned to the next available number
if ($add_r = mysql_query ($add_sql)) {
// The user successfully registered
print 'Thank you for registering!';
// Delete the key from the key database, so it cannot be used again
mysql_query ("DELETE FROM reg_keys WHERE regkey='$regkey'");
} else {
// The user did not successfully register
print 'Error:' . mysql_error(); // print the MySQL error
}
} else {
// The key is not valid
print 'The registration key you entered was not valid!';
}
} else {
// The regkey check query failed
print 'Error:' . mysql_error(); // print the MySQL error
}
} else { // The form was not submitted
// Display the form
print '<form action="register.php" method="post">
<table border="0">
<tr>
<td align="right">Username:</td>
<td align="center"><input type="text" name="username" /></td>
</tr>
<tr>
<td align="right">Password:</td>
<td align="center"><input type="password" name="password" /></td>
</tr>
<tr>
<td align="right">Registration Key:</td>
<td align="center"><input type="text" name="regkey" /></td>
</tr>
<tr>
<td></td>
<td align="center"><input type="submit" name="submit" value="Submit" /></td>
</tr>
</table>
</form>';
}
?>