Guest kilbad Posted August 1, 2006 Share Posted August 1, 2006 Currently I have the following index.php script::[code]<?php$id = $_GET['id'];if ($id == "") { include 'header.php'; include 'frontpage.php'; include 'footer.php'; } else { include 'header.php'; include "$id.php"; include 'footer.php'; } ?> [/code]where "id" is a passed variable that specifies the file name of the page that loads in the wrapper..My questions are these::1) In the unlikely, but possible, event that someone enters a random ID in the address line (like example.php?id=some_manual_entry ), how can I make the script automatically load a specific error page, instead of inserting the "Warning:...failed to open stream: No such file or directory ... on line ..." in the wrapper?2) Do I have to use register globals if I don't need to authenticate the user? [i] (note to self: http://us2.php.net/register_globals)[/i]Thanks again in advance! bt Quote Link to comment Share on other sites More sharing options...
obsidian Posted August 1, 2006 Share Posted August 1, 2006 try using file_exists() or something similar to make sure that the requested file is truly a real file. if it's not, then show your error message. Quote Link to comment Share on other sites More sharing options...
Guest kilbad Posted August 1, 2006 Share Posted August 1, 2006 just what I needed, thanks! 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.