Created
March 2, 2012 22:15
-
-
Save twaddington/1961768 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Server side code here --> | |
<?php | |
if ($_POST['action'] === 'logout') { | |
logout(); | |
} | |
?> | |
<!-- Client side code here --> | |
<form action="" method="post"> | |
<input type="hidden" name="action" value="logout" /> | |
<p><input type="submit" /></p> | |
</form> | |
<!-- This client-side code (html) is only sent from the server to the client if the logout button was pressed --> | |
<?php if ($_POST['action'] === 'logout'): ?> | |
<p><b>You were logged out!</b></p> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment