开发者

problem with seting GET value

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开发者_JAVA百科 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.


That should be:

if (!isset($_GET['id']))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜