Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // A Simple List of allowed users
- // You could substitute this code with a database connection
- $allowedUsers = array ("test" => "test",
- "smartfox" => "smartfox",
- "flash" => "flash");
- // The response variable
- $res = "res=KO";
- // Check incoming data
- if ($_POST['name'] != "" && $_POST['pass'] != "")
- {
- foreach($allowedUsers as $name => $password)
- {
- if ($_POST['name'] == $name && $_POST['pass'] == $password)
- {
- // Ok, user found
- $res = "res=OK";
- break;
- }
- }
- }
- print $res;
- ?>
Add Comment
Please, Sign In to add comment