Guest User

Untitled

a guest
May 10th, 2018
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2. include "newdb.php";
  3. $dbcon=connect_db();
  4. ?>
  5. <?php
  6. $username=$_POST["username"];
  7. $password=$_POST["password"];
  8. $fullname=$_POST["fullname"];
  9. //$username='toot';
  10. //$password='toot';
  11. $flag=0;
  12. $statement="insert into users(username,password,fullname) values('$username','$password','$fullname')";
  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. ?>
Add Comment
Please, Sign In to add comment