Anyway, here we go, I suppose.
The specific error I receive when I try to load the file is "Parse error: parse error, unexpected $end in <directory>\ndex.php on line 52". I've checked and re-checked quotations (both double and single), braces, and parentheses. I'm lost...any help is VERY greatly appreciated.
Code: Select all
<?php
if ($submit) {
$db = mysql_connect("localhost", "root", "");
mysql_select_db("DBname", $db);
$sql = "SELECT auth_level FROM user WHERE username = '$username' AND password = '$password' ";
$result = mysql_query($sql) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$auth_level = $rowї"auth_level"];
}
// Retrieve the authorization level from the table
// where the username and password are equal to
// the values submitted (simple Auth...just with
// permissions).
if (!mysql_num_rows($result)) {
echo "Whoa! Your credentials ain't no good here! Why don't ya bug me or my girlfriend for a proper login? Then again, you could just try again...with a correct password...";
// just bitches at the user for not being logged in/properly authed
} else {
setcookie('username', $_POSTї'username'], (time()+2592000), '/', '', 0);
setcookie('auth_level', $_POSTї'auth_level'], (time()+2592000), '/', '', 0);
}
//if credentials are good, set the cookie for both username and auth level
if ($auth_level == "3") {
header('Location: login.php');
} elseif ($auth_level == "2") {
header('Location: login.php');
} elseif ($auth_level == "1") {
header('Location: login.php');
} elseif ($auth_level == "0") {
header('Location: login.php');
}
else {
?>
<form method="POST" action="<?php echo $GLOBALS ї'PHP_SELF'];?>">
Name: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
<input type="submit" name="submit" value="Login">
</form>
<?php
}
?>