|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Errors with php authentication script
I am getting this error with the script below:
Parse error: parse error, unexpected T_VARIABLE in /htdocs/users/authenticate.php on line 25 I don't see any extra characters, do you guys see any? <?php if ((!$username) || (!$password)) { print "Please fill out both entries."; exit;} $db_name="tempagencyreviews"; $table_name="temp_user"; $connection = @mysql_connect("localhost", "xxxxx", "xxxxx") or die ("Couldn't connect."); $db= @mysql_select_db($db_name, $connection) or die("Couldn't select database."); $sql = "SELECT confirmed FROM temp_user WHERE username = '$username'"; $result = mysql_query("select confirmed from temp_user where username='$username'"); if (!$result) return "Could not execute query"; if ($confirmed == 1) { print "Your account has not been confirmed. <a href=\"/users/reconfirm.php\">Go here</a>"; exit; } $sql="select * from temp_user where username="$username" and password="$password""; $result = @mysql_query($sql,$connection) or die "Couldn't execute query."); $num = mysql_numrows($result); if ($num=0) { $msg = "<p> Congratulations, you're authorized!</p>";} else { echo "We were not able to authenticate your username. Did you forget your password and username? <a href=\"/users/retrieve.php\">Retrieve it here</a>. "; exit; } ?> |
|
#2
|
||||
|
||||
|
Change this
PHP Code:
To this: PHP Code:
and also change this PHP Code:
PHP Code:
|
|
#3
|
|||
|
|||
|
Thanks, that worked perfectly.. you're a godsend
![]() |
|
#4
|
||||
|
||||
|
Any time
Glad it worked for you.Did you notice the differences by the way? You can see the color differences in the code.. need to watch the quotes when doing queries.. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Errors with php authentication script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|