Advertisement
Guest User

Untitled

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