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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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