CBG Posted March 18, 2010 Share Posted March 18, 2010 Hi, I have the below bit code which works fine, however I would like to change it, to allow more files to be viewed, like it does with /offline.php I would like to allow /offline.php and /admin/offline.php and /admin/offlinemodify.php if ($offline['status'] == 'offline') { if (strcmp($_SERVER['PHP_SELF'],"/offline.php") != 0) { if ($offline['iporlogin'] == 'IP') { $ip = $_SERVER['REMOTE_ADDR']; if ($ip == $offline['ip1'] || $ip == $offline['ip2']) { } else { if ( $offline['status'] == 'offline' ) { header ('location: /offline.php'); } } } else { $username = $_SESSION['UserName']; if ($username == $offline['username']) { } else { if ( $offline['status'] == 'offline' ) { header ('location: /offline.php'); } } } } } Line 1: Check to see if it is in Offline Mode Line 2: Allow access to /offline.php (this is the bit I want to change to allow more files) Line 3-8: If offline is in IP Mode check IP Line 9: Else if not in IP mode but is offline do Login code Line 10-14: Login Mode check for user/pass access Line 15-17: Closing Tags Quote Link to comment https://forums.phpfreaks.com/topic/195694-allow-more-than-one-page-to-be-viewed/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.