Re: a simple include problem / issue (errr..I think)

From: Date: Mon, 31 Jul 2000 22:59:14 +0000
Subject: Re: a simple include problem / issue (errr..I think)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-9300@lists.php.net to get a copy of this message
Sandeep Hundal wrote: > Hi folks, > > I'm looking for a really simple answer here... I've see > some website have index.php display a page.... which is > normal. > > But then I've seen the same page also have index.php?id=foo > display different text with the same general layout... > > Now I can do stuff like www.blah.com/link.php?id=foo > > all i do is <? include($id. ".html"); ?> in link.php. > > But how do i make index.php show something, but > index.php?id=foo something else?? > > thanks!!! > > /sunny > Inside your index.php, insert: <?php if ($id == "foo") { <your code here> } else { <regular index.php code here> } ?>

« previous php.general (#9300) next »