Dynadot โ€” .com Transfer

[Resolved] How to limit access to admin file?

SpaceshipSpaceship
Watch
Impact
101
How to limit access to admin file?

I'm looking for some sort of code, script or technique, that limits complete access to my admin.php file without a password.

The admin.php file is the backend to one of my sites and does have a secure login before allowing access to website controls, however I would like to add another security measure.

Basically I'm looking for something like cPanel's directory password lock, except for a single file so that it cannot be read, open, or run without a password.

+Rep for all who assist me! :tu:
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
PHP:
<?

$password = md5("yourpassword");

if ($_POST['pass']) {
$pass = md5($_POST['pass']);
setcookie("password", $pass, time()+3600);
}

if ($_COOKIE["password"]) {
if ($_COOKIE["password"] !== $password) { exit; }
} else {
echo "
<form method=\"POST\" action=\"admin.php\">
<input type=\"text\" name=\"pass\" size=\"20\">
<input type=\"submit\" value=\"Submit\">
</form>
";
}

?>
 
1
•••
I just realized the admin page is encoded with Ioncube... Will the above code still work inserted in an Ioncube encoded page?
 
0
•••
1
•••
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back