Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 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. $mobile=$_POST["mobile"];
  9. $vcode=md5(substr($mobile, -4));
  10. $vcode = substr($vcode, 0, 6);
  11. //$username='toot';
  12. //$password='toot';
  13. $flag=0;
  14. $statement="insert into users(username,password,mobile,vcode) values('$username','$password','$mobile','$vcode')";
  15. if (mysqli_query($dbcon, $statement))
  16. {
  17. $myObj=new \stdClass();
  18. $myObj->result = "1";
  19. $myObj->vcode = $vcode;
  20. $myJSON = json_encode($myObj);
  21. echo $myJSON;
  22. exit();
  23. }
  24. else
  25. {
  26. $myObj=new \stdClass();
  27. $myObj->result = "2";
  28. $myJSON = json_encode($myObj);
  29. echo $myJSON;
  30. exit();
  31. }
  32. close_db();
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement