Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <?php
  2.  
  3. function authenticate($username, $password)
  4. {
  5.     $SETusername="todd";
  6.     $SETpassword="1234";
  7.    
  8.     if ($username==$SETusername && $password==$SETpassword) {
  9.             return true;
  10.         } else {
  11.             return false;
  12.             }
  13.  
  14.     //write code that checks the arguments to make sure they match and returns true or false
  15.     //if we're going to return true, store the username in the user's session
  16. }//end authenticate
  17.  
  18. function getUsername()
  19. {
  20.    
  21. }
  22. function loggedIn()
  23. {
  24.     if (isset ($_SESSION['name'])) {
  25.         echo ('<a href="logout.php">Logout</a><br />');
  26.         } else {   
  27.     echo ('<a href="login.php">Login</a>');
  28.         }
  29. }
  30.  
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement