tags:

views:

31

answers:

2

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?

+4  A: 

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.

Eric Petroelje
yes, it works. thanks
Syom
+2  A: 

That should be:

if (!isset($_GET['id']))
John Kugelman
no, i've test it
Syom