I have already tried google none of the solutions worked!
Hi, need some php help buddies!
When trying to run my script I get the following error.
|
Quote:
|
|
Parse error: parse error, unexpected $ in /home/auth.php on line 37
|
Heres my script:
| PHP Code |
<?php
if(!$_POST['submit']){
die("Hacking attempt");
};
if (!$username || !password ) {
if ( strlen($username) == 0) {
echo "There is no username entered. <br />";
};
if ( strlen($password) == 0) {
echo "There is no password entered. <br />";
};
exit;
} else {
$enpass = md5($password);
include('config.php');
$db = mysql_connect('localhost', $dbusername, $dbpassword);
if (!$db) {
echo 'Could not connect to MySQL server <br />';
exit;
};
@mysql_select_db($dbname) or die( "Unable to select database");
$query = "SELECT * FROM $login_table WHERE username = '$username'";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
if($password == $row[password]) {
echo "Welcome $row[username] you are now logged in.";
$_SESSION['login'] = $row[priv];
} else {
echo "Your username or password were incorrect. Please try again.";
};
?>
|
However line 37 is the end of the script just the
?>. I have check the script for missing ';' and any left over brackets and its all fine. I would appreciate any help.
Thanks in advance.
__________________
* tweet *
Private Message inbox is full, email "opserty" followed by an at and a "gmail" and a dot and a "com" to contact me. =]
Sanesh. says (22:54): We need to think up a PHPWomen chatup line
Kalle Almighty says (22:54): lol
Sanesh. says (22:55): how about "I tried to use the imagecreatefromyou() function on you, but the Parser returned a T_TOO_SEXY error" ?