Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "newdb.php";
- $dbcon=connect_db();
- ?>
- <?php
- $username=$_POST["username"];
- $password=$_POST["password"];
- $mobile=$_POST["mobile"];
- $vcode=md5(substr($mobile, -4));
- $vcode = substr($vcode, 0, 6);
- //$username='toot';
- //$password='toot';
- $flag=0;
- $statement="insert into users(username,password,mobile,vcode) values('$username','$password','$mobile','$vcode')";
- if (mysqli_query($dbcon, $statement))
- {
- $myObj=new \stdClass();
- $myObj->result = "1";
- $myObj->vcode = $vcode;
- $myJSON = json_encode($myObj);
- echo $myJSON;
- exit();
- }
- else
- {
- $myObj=new \stdClass();
- $myObj->result = "2";
- $myJSON = json_encode($myObj);
- echo $myJSON;
- exit();
- }
- close_db();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement