Advertisement
Guest User

Untitled

a guest
May 24th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <?php
  2. include "newdb.php";
  3. $dbcon=connect_db();
  4. ?>
  5. <?php
  6. SESSION_START();
  7. ?>
  8. <?php
  9. $username=$_GET["username"];
  10. $password=$_GET["password"];
  11. $flag=0;
  12. $statement="SELECT userid FROM users where username='$username' and password='$password'";
  13. //echo $statement;
  14. //exit();
  15. $result=mysqli_query($dbcon,$statement);
  16. while($row=mysqli_fetch_array($result) )
  17. {
  18. $flag=1;
  19. }
  20. close_db();
  21. if($flag==1)
  22. {
  23. $myObj=new \stdClass();
  24. $myObj->result = "ok";
  25. $myJSON = json_encode($myObj);
  26. echo $myJSON;
  27. exit();
  28. }
  29. else
  30. {
  31. $myObj=new \stdClass();
  32. $myObj->result = "ko";
  33. $myJSON = json_encode($myObj);
  34. echo $myJSON;
  35. exit();
  36. }
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement