Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = 'YourUsernameHere'; // change this! ~ if you want, you can set it to "guest" if you plan on giving out access
- $password = 'YourPasswordHere'; // change this!
- // Hey, I'm Nerdi from HF
- // CONTACT: http://hackforums.net/member.php?action=profile&uid=1356131
- // SKYPE: ASK IN PM
- /*
- PLEASE DO NOT EDIT THE SECTION BELOW. IT IS USED TO CREATE A UNIQUE SESSION ID FOR YOU. IT IS RECOMMENDED
- THAT YOU DO NOT USE THIS SCRIPT IN A PUBLIC PLACE... PRIVATE WIFI IS A MUST FOR THIS SCRIPT TO BE SECURE.
- IF YOU USE THIS SCRIPT ON PUBLIC WIFI, YOUR SESSION ID MAY BE HIJACKED, CAUSING UNAUTHORIZED ACCESS TO
- YOUR CONTENT.
- */
- $you = str_replace('.', 'x', $_SERVER['REMOTE_ADDR']); // this here is to create an IP-specific session ID for you to use
- $aCombo = md5($you . $username . $password);
- if(isset($_GET['session'])){
- $session = $_GET['session'];
- if($session === $aCombo){ // SUCCESS !
- /* NERDI'S SIMPLE PASSWORD PROTECTED PAGE TEMPLATE
- THE SECTION BELOW GIVES YOU ROOM TO USE WHATEVER HTML CONTENT YOU'D LIKE. THE <HTML>, <HEAD>, AND <BODY> TAGS ARE PROVIDED.
- PLEASE READ THE COMMENTS FOR FURTHER INSTRUCTION. SOME OF THE CODE IS COMMENTED, TO MAKE IT EASIER FOR YOU TO EDIT IT IF YOU'D LIKE!
- */
- // Feel free to start editing anywhere after the echo'
- // DO NOT REMOVE THE ECHO'
- echo'
- <html>
- <head>
- </head>
- <body>
- </body>
- </html>
- '; // DO NOT REMOVE THIS LINE
- } // close session combo match
- } // get session
- else { // if session is not set
- if(isset($_POST['submit'])){
- $userSub = $_POST['username'];
- $pwSub = $_POST['password'];
- $newSession = md5($you . $userSub . $pwSub);
- if($newSession === $aCombo){ // if our new session qualifies as an admin session
- echo'<meta http-equiv="refresh" content="0; url=index.php?session=' . $newSession . '">';
- } else {
- echo'<h1>That\'s an INVALID LOGIN!</h1>';
- }
- } else {
- /*
- IF YOU WANT TO EDIT HOW YOUR LOGIN PAGE LOOKS, EDIT THE FORM BELOW.
- REMOVING USER/PASS WILL CAUSE THIS SCRIPT NOT TO WORK.
- */
- echo'<h1>Admin Login</h1>
- <form action="" method="post">
- <strong>USERNAME</strong><br />
- <input type="text" name="username"/><br /><br />
- <strong>PASSWORD</strong><br />
- <input type="text" name="password"/><br /><br />
- <input type="submit" name="submit" value="Log In"/>
- </form>';
- } // close if POST is set
- } // close if session is set
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement