Jump to content

php include question


odetron

Recommended Posts

$pg = 1;
$_GET[$pg];
//Draws the page data
if ($pg == 1)
{ 
include("news1.inc.html");
}

if ($pg == 2)
{
include("news2.inc.html");
} 

what i whant this code to do is change the site content depending on what the url is. like index.php?pg=2 would bring up hello world 2 and just index. php would bring up hello world. but on both i keep getting the one for $pg = 1 why won't this work?

Link to comment
https://forums.phpfreaks.com/topic/38058-php-include-question/
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.