Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <?php
  2. require_once("config.php");
  3.  
  4. $auth_host = $GLOBALS['auth_host'];
  5. $auth_user = $GLOBALS['auth_user'];
  6. $auth_pass = $GLOBALS['auth_pass'];
  7. $auth_dbase = $GLOBALS['auth_dbase'];
  8.  
  9.  
  10. $db = mysqli_connect($auth_host, $auth_user, $auth_pass,$auth_dbase) or die("Error " . mysqli_error($db));
  11.  
  12.  
  13. $user_name = mysqli_real_escape_string($db,$_POST['name']);
  14. $user_password = mysqli_real_escape_string($db,$_POST['password']);
  15.  
  16. $sql = mysqli_query($db,"SELECT * FROM as_users WHERE (username = '$user_name')");
  17. $rows= mysqli_num_rows($sql);
  18. if($rows > 0){
  19. echo "true";
  20. }else{
  21. echo "false";
  22. }
  23. mysqli_close($db);
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement