![]() Topic awaiting preservation: More learning... (Page 1 of 1) |
|
|---|---|
|
Bipolar (III) Inmate From: Kansas City, MO , USA |
posted 05-27-2005 03:50
I am still in the process of learning PHP a bit more... One of my self teaching aides is this here: code: echo "<h1>Header</h1>";
$intro = "Jabber jabber jabber!!!";
$text1 = "Blah blah blah!!!";
$text2 = "Yadda yadda yadda!!!";
$page = $_GET['!'];
if (($page == "home") or ($page =="")) {
echo $intro;
} else if($page == "test") {
echo $text1; }
if($page == "test2") {
echo $text2;
}
echo "<h3>Footer</h3>";
|
|
Paranoid (IV) Inmate From: France |
posted 05-27-2005 08:25
Sure, you can put all the possibles values of $page in an Array, and display them with a some markup around. i.e. code: $pagesArray = Array( "home", "test", "test2" );
echo "\n<ul id='navigation'>";
foreach( $pagesArray as $whichPage )
echo "\n\t<li><a href='?!=". $whichPage ."'>"+ $whichPage +"</a></li>";
echo "\n</li>\n\n"; |
|
Maniac (V) Inmate From: there...no..there..... |
posted 05-27-2005 12:41
I like to use a switch function if there are many pages to call. Kind of keeps everything a little more neat. |
|
Bipolar (III) Inmate From: Kansas City, MO , USA |
posted 05-27-2005 16:45
POI I tried your way, and all I get is a 000... I will keep playing around and see if I can figure it out, thanks for the help =) |
|
Paranoid (IV) Inmate From: France |
posted 05-27-2005 17:47
|
|
Bipolar (III) Inmate From: Kansas City, MO , USA |
posted 05-28-2005 03:25
I thought the "+"s looked out of place, and I couldn't find any reference of using a + in that way on PHP.net. =) |