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"];
- $fullname=$_POST["fullname"];
- //$username='toot';
- //$password='toot';
- $flag=0;
- $statement="insert into users(username,password,fullname) values('$username','$password','$fullname')";
- if (mysqli_query($dbcon, $statement))
- {
- $myObj=new \stdClass();
- $myObj->result = "1";
- $myJSON = json_encode($myObj);
- echo $myJSON;
- exit();
- }
- else
- {
- $myObj=new \stdClass();
- $myObj->result = "2";
- $myJSON = json_encode($myObj);
- echo $myJSON;
- exit();
- }
- close_db();
- ?>
Add Comment
Please, Sign In to add comment