Jump to content

another $_GET question


doddsey_65

Recommended Posts

my index.php file includes different files depending on the get value. all of them work except this one:

 

elseif (isset($_GET['forum']) && $_GET['child']) {

include 'modules/pages/children.php';

}

 

when i point my browser to index.php?forum=1&child=1 it stays on the same page. Do i need to include something else when getting a url with 2 $_GETs?

Link to comment
https://forums.phpfreaks.com/topic/215262-another-_get-question/
Share on other sites

Your code should work, given that just $_GET['child'] in the IF expression will check if it's true/1.

 

Try adding some debugging:

 

elseif (isset($_GET['forum']) && $_GET['child']) {

exit('foo');
include 'modules/pages/children.php';

}

 

If you don't see "foo" then you know the problem is with your logic. A possible problem could be if you have just isset($_GET['forum']) in a previous expression, then obviously this else-if expression won't ever get evaluated.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.