Hello,
thank you for the corrections in the code, i've made the changes and there's no more error, but each time I run it in my browser it always show part of my script and also shows the links to both access levels 1 and 2.
here's the output in the browser:
' .$sql.'
'.mysql_error()); 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
Click here to continue
'; } if ($auth == '2') { echo '
You are logged in with a level 2 authorisation
Click here to continue
'; } } ?>
and here's the php script as it currently is:
<?php
if($_POST['submit']) {
$session = mysql_connect("localhost", "Username", "Password");
mysql_select_db("xplosive") or die(mysql_error());
$sql = ("SELECT Auth FROM Staff
WHERE Username = '".$_POST['Username']."'
AND Password = '".$_POST['Password']."'"
);
$result = mysql_query($sql)or die('<hr />' .$sql.'<hr />'.mysql_error());
while ($row = mysql_fetch_array($result)) {
$auth=$row['Auth'];
}
if (!mysql_num_rows($result)) {
echo 'ACCESS DENIED: Invalid Login details';
}
if ($auth=='1') {
echo '<p>You are logged in with a level 1 authorisation <BR><a href="admin.php">Click here</a> to continue </p>';
}
if ($auth == '2') {
echo '<p>You are logged in with a level 2 authorisation <BR/><a href="admin.php">Click here</a> to continue</p>';
}
}
?>
Thank you