Advertisement
Guest User

Untitled

a guest
May 26th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php
  2.  
  3. //Important variables
  4. $username = $_POST['username'];
  5. $password = $_POST['password'];
  6. $file = "users.txt";
  7. $text = "\n$username\n$password\n";
  8.  
  9. /////////////////////////////////////////////////////////
  10. //Checks for only numbers and letters
  11.  
  12. function check_for_correct_values($input, $text)
  13.     {
  14.         if (! eregi("^[a-zA-Z0-9]*$", $text) )
  15.         {
  16.         echo $text;
  17.         }  
  18.     }
  19.  
  20. check_for_correct_values($username, 'Username contains invalid characters.<br><br>')
  21.  
  22. check_for_correct_values($password, 'Password contains invalid characters.<br><br>')
  23.  
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement