Computers |
|
| | #1 (permalink) |
| Newb Techie Join Date: Sep 2007
Posts: 31
| 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>'; } ?> |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| BOOT ERROR - diagnosing | mrlewp | Windows Operating Systems and Software | 0 | 09-18-2007 05:10 AM |
| Parse Error | mademokid | Programming Discussions | 2 | 07-09-2007 02:39 PM |
| I need some help | trose | Hardware Troubleshooting | 3 | 06-05-2007 10:12 PM |
| IE error | ItHurtz | Browser & General Internet Questions | 4 | 06-01-2007 04:01 PM |
| DRM content, parameter error | ohGrFreak | Windows Operating Systems and Software | 2 | 04-27-2007 11:27 AM |