FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Php nav links?

 


SFMeatwad
I've been to several sites and none of them have worked for either errors or whatever.

Can someone please tell me how?

Thanks.
{name here}
SFMeatwad wrote:
I've been to several sites and none of them have worked for either errors or whatever.

Can someone please tell me how?

Thanks.

Code:

echo '<a href="index.html">Site Home</a>';
DanielXP
Code:
switch($_GET['action']) {
default:
echo "welcome to default page!<br><br>
<a href='page.php?action=page1'>go to page 1</a><br>
<a href='page.php?action=page2'>go to page 2</a>";
break;

case "page1":
echo "welcome to page 1";
break;

case "page2":
echo "welcome to page 2";
break;
}
?>
fromegame
Code:

<?php
if(!isset($_GET['page'])) {
    include("default.php");
}else{
    include($_GET['page'] . ".php");
}
?>


Like that Twisted Evil
sonam
Can you explain little bit more what do you want!

Sonam
DanielXP
fromegame wrote:
Code:

<?php
if(!isset($_GET['page'])) {
    include("default.php");
}else{
    include($_GET['page'] . ".php");
}
?>


Like that Twisted Evil


This one is ok but your letting any page be viewed on here.

Basicly if the page is not set it will include the code of 'default.php' but is there is a page set such as 'page1' then it would include 'page1.php'
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.