Browse > Home / General Tutorials, Webmaster Tutorials / Simple login system with php

| Subcribe via RSS

Simple login system with php

June 1st, 2009 Posted in General Tutorials, Webmaster Tutorials
Today I will be creating my first post for WarezTeacher and to help you create a simple login system for your admin… 

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.

  1. <?php
  2. session_start();//this will be used to hold your admin session
  3. $MyPassword = "Admin"; //this will be your login password
  4. $Form = '<form action="" method="post" name="loginForm">
  5. <input name="password" type="password" />
  6. <input type="submit" value="Submit" />';
  7.  
  8. if(!$_SESSION['AdminAuth']){//check if allready logged in
  9. if(!$_POST['password']){
  10. die($Form);
  11. }else{
  12. if($_POST['password'] != $MyPassword ){
  13. die('PASSWORD FAIL!');
  14. }else{
  15. $_SESSION['AdminAuth'] = TRUE;
  16. }
  17. }
  18. }
  19. ?>

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:

  1. 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.

3 Responses to “Simple login system with php”

  1. Simple login system with php | Warez Teacher | Webmaster Tools Says:

    [...] Read the rest here:  Simple login system with php | Warez Teacher [...]


  2. Simple login system with php | Warez Teacher Says:

    [...] original post here: Simple login system with php | Warez Teacher Share and [...]


  3. Simple login system with php | Warez Teacher Says:

    [...] the rest here:  Simple login system with php | Warez Teacher SHARETHIS.addEntry({ title: “Simple login system with php | Warez Teacher”, url: [...]


Leave a Reply

You must be logged in to post a comment.