Advertisement
gitlez

YA: Masked Data 20130603212216AA1IFFJ

Jun 4th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <?php
  2. // http://answers.yahoo.com/question/answer?qid=20130603212216AA1IFFJ
  3.  
  4.  
  5. // Obviously you can make the key anything you want.
  6. defined('THE_KEY')? null : define('THE_KEY', 'jake whitton' );
  7. defined('AUTHORIZED')? null : define('AUTHORIZED', (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), THE_KEY) !== false) );
  8.  
  9.  
  10. /***   Authenticate   ***/
  11. if( !AUTHORIZED ){
  12.     echo 'pageok';
  13.     exit;
  14. }
  15.  
  16. echo '<h2>Welcome Jake</h2>';
  17.  
  18. echo '<p>These contents can only be viewed by anyone with the knowledge of the key.</p>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement