Simple login system with php
Firslty we need to create a file that will hold your password and security check!
Step 1 (Create Auth File).
Create a new file and name it anything you want but for this example we’ll use auth.php.
-
<?php
-
session_start();//this will be used to hold your admin session
-
$MyPassword = "Admin"; //this will be your login password
-
$Form = '<form action="" method="post" name="loginForm">
-
<input name="password" type="password" />
-
<input type="submit" value="Submit" />';
-
-
if(!$_SESSION['AdminAuth']){//check if allready logged in
-
if(!$_POST['password']){
-
die($Form);
-
}else{
-
if($_POST['password'] != $MyPassword ){
-
die('PASSWORD FAIL!');
-
}else{
-
$_SESSION['AdminAuth'] = TRUE;
-
}
-
}
-
}
-
?>
Now what ever pages you want to secure you should just include the file with the include command at the very top of your sucure page.
Hope you like this tutorial and please stay tuned at WarezTeacher for more!!!
Related posts:
- Simple PHP Users Online Script It’s always handy to have a simple script on your...
Related posts brought to you by Yet Another Related Posts Plugin.
![[Google]]( http://www.warezteacher.com/wp-content/plugins/easy-adsenser/google-light.gif)

June 1st, 2009 at 4:34 PM
[...] Read the rest here: Simple login system with php | Warez Teacher [...]
June 1st, 2009 at 6:43 PM
[...] original post here: Simple login system with php | Warez Teacher Share and [...]
June 1st, 2009 at 7:30 PM
[...] the rest here: Simple login system with php | Warez Teacher SHARETHIS.addEntry({ title: “Simple login system with php | Warez Teacher”, url: [...]