Advertisement
Guest User

PHPConnect

a guest
Feb 9th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php
  2. $host = "mysql.hostinger.ae";
  3. $username = "user";
  4. $password = "pass";
  5. $db_name = "db";
  6.  
  7. mysql_connect("$host", "$username", "$password")or die("cannot connect");
  8. mysql_select_db("$db_name")or die("cannot select DB");
  9.  
  10. $myhwid = $_POST['HWID'];
  11. $mypassword = $_POST['Password'];
  12.  
  13. $myhwid = stripslashes($myhwid);
  14. $mypassword = stripslashes($mypassword);
  15.  
  16. $myhwid = mysql_real_escape_string($myhwid);
  17. $mypassword = mysql_real_escape_string($mypassword);
  18.  
  19. $sql = "SELECT * FROM `AppJoiner` WHERE HWID='$myhwid' and Password='$mypassword' and Activated='yes'";
  20. $result=mysql_query($sql);
  21.  
  22. $count=mysql_num_rows($result);
  23.  
  24.  
  25. if($count==1){
  26.  echo '#SUCCESS#';
  27.  }
  28. else {
  29. echo "#WRONG#";
  30.  }
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement