Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 09-29-2007, 10:06 AM   #1 (permalink)
 
Newb Techie

Join Date: Sep 2007

Posts: 31

cfgcjm is on a distinguished road

Default Parse error

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>';
}


?>
cfgcjm is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
BOOT ERROR - diagnosing mrlewp Windows Operating Systems and Software 0 09-18-2007 06:10 AM
Parse Error mademokid Programming Discussions 2 07-09-2007 03:39 PM
I need some help trose Hardware Troubleshooting 3 06-05-2007 11:12 PM
IE error ItHurtz Browser & General Internet Questions 4 06-01-2007 05:01 PM
DRM content, parameter error ohGrFreak Windows Operating Systems and Software 2 04-27-2007 12:27 PM