ItsWesYo Posted July 18, 2007 Share Posted July 18, 2007 Is there anyway to hide a page in php? Example: I make a page called test.php It is public (on a navigation menu, etc) I don't want the real content to show up Instead, maybe a message, like "This page is currently getting a revamp" or "This page is down due to [reason here]" Quote Link to comment Share on other sites More sharing options...
ryeman98 Posted July 18, 2007 Share Posted July 18, 2007 There are a few things you could do... If you have a User System, you could have it so only Administrators could view it. OR Do you know your IP address? <?php if ($_SERVER['REMOTE_ADDR'] == "Your IP address here") { ?> All content within' <?php } else { echo "This page is getting a revamp"; ?> OR You could hide it with CSS and but then you wouldn't be able to view it. But that should be alright if you just want to display a message. Quote Link to comment Share on other sites More sharing options...
ItsWesYo Posted July 18, 2007 Author Share Posted July 18, 2007 Yes, I know my IP address. Hm, thank you though! Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 18, 2007 Share Posted July 18, 2007 not the smartest idea if your ISP uses DDNS or some sort of IP pool leasing system Quote Link to comment Share on other sites More sharing options...
ryeman98 Posted July 18, 2007 Share Posted July 18, 2007 not the smartest idea if your ISP uses DDNS or some sort of IP pool leasing system True, but it can really depend on what kind of site it is and who has access to it... If it's only for a short amount of time then I think it would be alright... but you can try something else. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 18, 2007 Share Posted July 18, 2007 this is a better idea, make a page that sets a session like this sessioner.php <?php session_start(); $_SESSION['access'] = "full"; ?> then on test.php <?php session_start(); if($_SESSION['access'] != "full"){ exit("Opps Not done yet"); } ?> Just open up sessioner.php for your needs via chmod then simply lock it down after wards. Quote Link to comment Share on other sites More sharing options...
ItsWesYo Posted July 19, 2007 Author Share Posted July 19, 2007 Yes, it it just temporary. I really don't care if people see it, but I'd prefer not to. Quote Link to comment Share on other sites More sharing options...
ryeman98 Posted July 19, 2007 Share Posted July 19, 2007 What if you did this... <?php $_SESSION['ip'] = $_SERVER['REMOTE_ADDR']; if ($_SESSION['ip'] = "Your IP Address") { ?> All content <?php } else { echo "This part of the site is getting a revamp."; } ?> Or is that pretty much the same thing? Quote Link to comment 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.