Hello!
A while ago I had a nice authentication script for the admin pages on my site. It all worked perfectly until I moved the site to a different server. On this server, every PHP script has to have "#!/usr/bin/php" on top of the page, and I think that is the reason why it isn't working anymore.
This is what I used as script, it was required on every page.
if (!isset($PHP_AUTH_USER))
{
echo "Please log in to enter the admin pages!";
exit;
}
else
{
if (isset($PHP_AUTH_USER))
{
require("includes/mysql.php3");
$res = mysql_query("SELECT * FROM users WHERE username='$PHP_AUTH_USER' and password='$PHP_AUTH_PW'");
$rows = mysql_num_rows($res);
if ($rows != "0")
{
}
else
{
echo "You have to login to access the admin section!";
exit;
}
}
}
Does anyone know of a way to get this to work? It would be appreciated 🙂