Jump to content

Concerning:: Preventing warning messages, and globals off


Guest kilbad

Recommended Posts

Guest kilbad
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
Link to comment
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.