Hello
I'm trying to create an authorisation system with 2 different access levels, levels 1 and 2 I have created a php script and an html page to run this function each time i try load the htnl form in my browser and fill the form it always loads the php script (which is a good thing a that is what its supposed to do but the php page always displays this error message:
Parse error: parse error, unexpected $end in d:\phpweb\admin_system\adminlogin.php on line 20
it seems i ended the script illegally, i don't know what else to add please help me out, the scripts are below
here's the php script
<?php
if ($submit)
$session = mysql_connect("localhost", "username", "password");
mysql_select_db("xplosive");
$sql = "
SELECT Auth
FROM Staff
WHERE Username = '$username'
AND Password = '$password'
";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
$auth = $row["auth"];
If (!mysql-num-rows($result)) {
echo "ACCESS DENIED: Invalid Login details";
}
If ($auth == "1") {
echo "You are logged in with a level 1 authorisation.<br/>
<a href='admin.php'>Click here to continue</a>";
?>
and here's the html code
<html>
<head> <title> ADMIN LOGIN </title> </head>
<body>
<form method="POST" action="adminlogin.php" ENCTYPE="multipart/form-data">
Name:<input type="text" name="username"><br/>
<br/>
Password: <input type="password" name="password">
<br/>
<input type="submit" name="submit" value="LOGIN">
</form>
</body>
<html>