File Submitter: Cool Surfer
File Submitted: 28 Feb 2006
File Updated: 22 Mar 2006
File Category: General Tools
This is a simple script that you can add to your codes and mod files, so that an unauthorised user
cant misuse the file.
Just add the code like this eg:
if admin.php is
<?php
echo "hello php1"
?>
add the password code like this
CODE
session_start();
if ( $_POST['password'] == "your-password" ){
$_SESSION['isadmin'] = "yes";
header("location: http://".$_SERVER['HOST'].$_SERVER['REQUEST_URI']);
}
if ( $_SESSION['isadmin'] != "yes" ){
echo '<body text="#00FF00" bgcolor="#000000"><center>
Enter Your password:
<form action="" name="login" method="post">Password:<input type="password" name="password"><input type="submit" value="login"></form>
<a href=mailto:coolsurfer@gmail.com><font color="#00FF00">Cool Surfer Email</font></a>
<a href=http://xpindia.com>
<font color="#00FF00">XpIndia.Com</font></a></center>';
die();
}
echo "hello php1"
?>
Regards
CS
coolsurfer@gmail.com
www.xpindia.com
PS: Just refresh your browser ( hit f 5) after entering the pwd, else you will see a blank page.
Nothing to worry
Click here to download this file





Contributor














