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 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
Archived
This topic is now archived and is closed to further replies.