Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2. include "newdb.php";
  3. $dbcon=connect_db();
  4. ?>
  5. <?php
  6. $username=$_POST["username"];
  7. //$username='selva';
  8. //$password='password';
  9. $flag=0;
  10. $statement="UPDATE users SET password = '12345' where username = '$username'";
  11. //echo $statement;
  12. //exit();
  13. if (mysqli_query($dbcon, $statement))
  14. {
  15. $myObj=new \stdClass();
  16. $myObj->result = "1";
  17. $myJSON = json_encode($myObj);
  18. echo $myJSON;
  19. exit();
  20. }
  21. else
  22. {
  23. $myObj=new \stdClass();
  24. $myObj->result = "2";
  25. $myJSON = json_encode($myObj);
  26. echo $myJSON;
  27. exit();
  28. }
  29. close_db();
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement