Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. session_start();
  2. include("includes/config.php");
  3. if($_SERVER["REQUEST_METHOD"] == "POST")
  4. {
  5.     $myusername = addslashes($_POST['username']);
  6.     $mypassword = addslashes($_POST['password']);
  7.  
  8.     $sql = "SELECT  userid FROM tbl_users where username='$myusername' and password='$mypassword'";
  9.     $result = mysql_query($sql);
  10.     $count = mysql_num_rows($result);
  11.  
  12.     if($count == 1){
  13.         $_SESSION['login_admin']=$myusername;
  14.         header("location: http://localhost/clogin1/admin/");
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement