Guest User

Untitled

a guest
Aug 2nd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. how long do $_POST variables stay active, and how does PHP decide what goes in the post array?
  2. <pre>
  3.  
  4. $user = $_POST['user'];
  5. $pass = $_POST['pass'];
  6.  
  7. if(isset($user) && $user !== null){
  8. if(isset($pass) && $pass !== null)
  9. echo 'true'
  10. else
  11. echo 'false';
  12. }
  13.  
  14.  
  15. </pre>
  16.  
  17. <pre>
  18. $.post('script.php',{user: 'username'}) -> posts to the script, but doesn't
  19. return anything, as in this case it would return false
  20.  
  21. <em>5 minutes later</em>
  22.  
  23. $.post('script.php',{pass: 'password'}, function(data){
  24. alert("data returned: " + data);
  25. });
  26.  
  27. </pre>
Add Comment
Please, Sign In to add comment