Jump to content

[SOLVED] How to do page navigation bar using php codes?


phpRoshan

Recommended Posts

There are many ways to do it, an easy way is to do something like this:

<?php
echo <<<END
<div id='nav'>
<a href="home.php?nav=a">nav1</a>
<a href="home.php?nav=b">nav2</a>
<a href="home.php?nav=c">nav3</a>
<a href="home.php?nav=d">nav4</a>
<a href="home.php?nav=e">nav5</a>
</div>
END;
?>

 

Then in home.php have a switch case function like :

<?php

switch ($nav) {
case a:
include page1.php;
break;
case b:
include page2.php;
break;
case c:
include page3.php;
break;
case d:
include page4.php;
break;
case e:
include page5.php;
break;
default :
}
?>

 

But I suggest you look these up in the php manual pages to get better understanding, happy coding

 

 

  • 4 years later...

How Make Page Navigation in php without reloading the page without jquery like facebook has. ex. for welcome page : http://www.facebook.com/?sk=welcome for friends list : http://www.facebook.com/?sk=ff&ap=1 for news feed link http://www.fack.com/?sk=nf

 

with clicking the link instead of reloading whole page the appropriate content be loaded. how to do this without javascript, jquery

How Make Page Navigation in php without reloading the page without jquery like facebook has. ex. for welcome page : http://www.facebook.com/?sk=welcome for friends list : http://www.facebook.com/?sk=ff&ap=1 for news feed link http://www.fack.com/?sk=nf

 

with clicking the link instead of reloading whole page the appropriate content be loaded. how to do this without javascript, jquery

If you don't want to use javascript then you'll have to use iframes.

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.