Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. $action = $_POST['action'];
  4.  
  5. switch ($action){
  6.  
  7. case "logIn":
  8. $username = "me";
  9. $password = "me";
  10.  
  11. if ($_POST['username']==$username&&$_POST['password']==$password){
  12. $data = Array(
  13. 'success' => true,
  14. 'sessionId' => '582647193'
  15. );
  16. echo json_encode($data);
  17. } else {
  18. echo json_encode(['success' => true]);
  19. }
  20. break;
  21. case "contactUpdate":
  22. $newPhone = $_POST['phone'];
  23. $newEmail = $_POST['email'];
  24. //input $newPhone and $newEmail ino database
  25. //if success:
  26. echo json_encode(['success' => true]);
  27. break;
  28. }
  29.  
  30.  
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement