Jump to content

Query String


wpmcgirth

Recommended Posts

Hello. I'm having some trouble putting my website to work. It used to work before on another host, but it doesn't work on my current one.

Here's the piece of code i'm having trouble with:

[code]<?PHP
if($section=="home") {
include "main.php";
} elseif($section=="link") {
include "link.php";
} elseif($section=="contact") {
include "contact.php";
} elseif($section=="devs") {
include "devs.php";
} elseif(!$page) {
include "main.php";
}
?>[/code]

No matter what's after the ? on the address bar, it always includes main.php on the page. and if i comment the elseif(!$page) part, like this:

[code]<?PHP
if($section=="home") {
include "main.php";
} elseif($section=="link") {
include "link.php";
} elseif($section=="contact") {
include "contact.php";
} elseif($section=="devs") {
include "devs.php";
} /* elseif(!$page) {
include "main.php";
} */
?>[/code]

it includes nothing.

Anyone could help?
Link to comment
https://forums.phpfreaks.com/topic/34786-query-string/
Share on other sites

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.