Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // http://answers.yahoo.com/question/answer?qid=20130603212216AA1IFFJ
- // Obviously you can make the key anything you want.
- defined('THE_KEY')? null : define('THE_KEY', 'jake whitton' );
- defined('AUTHORIZED')? null : define('AUTHORIZED', (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), THE_KEY) !== false) );
- /*** Authenticate ***/
- if( !AUTHORIZED ){
- echo 'pageok';
- exit;
- }
- echo '<h2>Welcome Jake</h2>';
- 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