Advertisement
Guest User

Untitled

a guest
May 30th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php session_start(); ?>
  2. <html>
  3. <head />
  4. <body>
  5. <form action='index.php?login=yes' method=POST>
  6. Username: <input type=text name='user'><br />
  7. Password: <input type=password name='pass'><br />
  8. <input type=submit value='go!'>
  9. </form>
  10.  
  11. <?php
  12.    
  13.     $user=$_POST['USER'];
  14.     $pass=$_POST['pass'];
  15.     $login=$_GET['login'];
  16.    
  17.     if($login=='YES'){
  18.         $con=mysql_connect('67.220.217.230','test',");
  19.         mysql_select_db('login');
  20.        
  21.         $get=mysql_query('SELECT count(id) FROM login WHERE user='$user' AND pass='$pass");
  22.         $result=mysql_result($get, 0);
  23.        
  24.         mysql_close($con);     
  25.        
  26.         if ($result!=1) echo"Login failure!";
  27.         else{
  28.             echo "Login success!";
  29.             $_SESSION['user']=$user;
  30.         };
  31.     };
  32.        
  33. ?>
  34.    
  35. </body>
  36. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement