Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'includes/db.php';
- // Check whether username or password is set from android
- if(isset($_POST['username']) && isset($_POST['password']) && isset($_POST['fullname']))
- {
- // Innitialize Variable
- $result='';
- $fullname = $_POST['fullname'];
- $username = $_POST['username'];
- $password = $_POST['password'];
- $mobile = $_POST['mobile'];
- $make = $_POST['make'];
- $model = $_POST['model'];
- $rn = $_POST['rn'];
- // Query database for row exist or not
- $sql='insert into users(fullname,username,password) values(:fullname,:username,:password)';
- //$sql = 'SELECT * FROM users WHERE username = :username AND password = :password';
- $stmt = $conn->prepare($sql);
- $stmt->bindParam(':fullname', $fullname, PDO::PARAM_STR);
- $stmt->bindParam(':username', $username, PDO::PARAM_STR);
- $stmt->bindParam(':password', $password, PDO::PARAM_STR);
- if ($stmt->execute())
- {
- $result=['status'=>'true'];
- }
- else
- {
- $result=['status'=>'false'];
- }
- // send result back to android
- echo json_encode($result);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement