Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

check_username.php 580B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. require_once('config.php');
  3. //initialize php variables used in the form
  4. $username = "";
  5. //check to see that the form has been submitted
  6. if(isset($_POST))
  7. {
  8. $username = $_POST['username'];
  9. $userTools = new UserTools();
  10. if ($username == "")
  11. {
  12. echo "How about something we can read";
  13. }
  14. else if ($userTools->checkUsernameExists($username))
  15. {
  16. //successful login, redirect them to a page
  17. echo "That username is taken =(";
  18. }
  19. else
  20. {
  21. echo "true";
  22. }
  23. }
  24. else
  25. {
  26. echo "Error";
  27. }
  28. ?>