in my site i want to set default page to open, using this script
if (!isset($_GET))
{
$_GET['id'] = "home";
}
when i open index.php it must set $_GET['id'] = "home" but it doesn't work. can somebody explain why?
in my site i want to set default page to open, using this script
if (!isset($_GET))
{
$_GET['id'] = "home";
}
when i open index.php it must set $_GET['id'] = "home" but it doesn't work. can somebody explain why?
Try:
if (empty($_GET['id']))
{
$_GET['id'] = "home";
}
The $_GET variable itself will always be set, which is why your current code isn't working.