Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $action = $_POST['action'];
- switch ($action){
- case "logIn":
- $username = "me";
- $password = "me";
- if ($_POST['username']==$username&&$_POST['password']==$password){
- $data = Array(
- 'success' => true,
- 'sessionId' => '582647193'
- );
- echo json_encode($data);
- } else {
- echo json_encode(['success' => true]);
- }
- break;
- case "contactUpdate":
- $newPhone = $_POST['phone'];
- $newEmail = $_POST['email'];
- //input $newPhone and $newEmail ino database
- //if success:
- echo json_encode(['success' => true]);
- break;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement