Advertisement
Guest User

Untitled

a guest
Jun 17th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?PHP
  2. mysql_connect("localhost","prang123","whydoyouwannaknow") or die ("Can not connect to the database");
  3. mysql_select_db("user_db") or die ("Can not find the database");
  4.  
  5.  
  6. $myusername=$_POST["username"];
  7. $mypassword=$_POST["password"];
  8.  
  9.  
  10. $sql="SELECT * FROM users WHERE Username='".$myusername."' and Password='".$mypassword."'";
  11. $result=mysql_query($sql);
  12. //
  13.  
  14. // Mysql_num_row is counting table row
  15. $count=mysql_num_rows($result);
  16. // If result matched $myusername and $mypassword, table row must be 1 row
  17.  
  18.  
  19. if ($count= 1) {
  20. $check ==1;
  21. } else {
  22. $check ==2;
  23. };
  24.  
  25. print "&check1=$check&postuser=$myusername&postpass=$mypassword&count=$count";
  26.  
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement