Checking for existance of variables

Any time a page expects variables to be passed to it, you should check to make sure they're actually there. The isset function allows you to determine if the variables you want actually exist. A nice feature of isset is it can test for multiple variables in one pass.

Here are two examples of how you can use isset. The first is as a conditional, either do this, or that. The second is more of a you can't do this unless you do that.

// do this or that
if (isset($_GET['id']))
{
do_this();
}
else
{
do_that();
}

// don't do this unless X was passed
if (!isset($_GET['X']))
die(""Error, condition not met."");

See www.php.net for the full isset() documentation.