Guest User

Untitled

a guest
Apr 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. <?php // Script 13.2 - functions.php
  2. /* This page defines custom functions. */
  3.  
  4. // This function checks if the user is an administrator.
  5. // This function takes two optional values.
  6. // This function returns a Boolean value.
  7. function is_administrator($name = 'Samuel', $value = 'Clemens') {
  8.  
  9. // Check for the cookie and check its value:
  10. if (isset($_COOKIE[$name]) && ($_COOKIE[$name] == $value)) {
  11. return true;
  12. } else {
  13. return false;
  14. }
  15.  
  16. } // End of is_administrator() function.
  17.  
  18. ?>
Add Comment
Please, Sign In to add comment