Created
August 20, 2012 06:37
-
-
Save dice/3401586 to your computer and use it in GitHub Desktop.
PHP code snippet for FullCourt SMS Authentication Sample Code
This file contains 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
function user_login($username, $submitted) { | |
// Retrieve the stored password | |
$stored = $_SESSION['password']; | |
// Compare the retrieved vs the stored password | |
if ($stored == $submitted) { | |
$message = "Hello and welcome back $username"; | |
} else { | |
$message = "Sorry, that's an invalid username and password combination."; | |
} | |
// Clean up after ourselves | |
unset($_SESSION['username']); | |
unset($_SESSION['password']); | |
return $message; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment