Jump to content

Recommended Posts

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.