How to open links to pages correctly
Posted 11 March 2006 - 07:19 PM
When using my webpage everytime a link is clicked on, a totally new page is opened. I want it so that the navigation bar is always displayed on the side of the page no matter what the user is doing. Currently i am using the following code for the navigation bar:
<a href="contact.php">Contact Us</a><br><br>
As you can see the menu page is in html and some of the other pages are also in html or in php. Currently whenever a page is clicked on the navigation bar dissappears and a new page is created. How do i do it so that the navigation bar always stays on the side??
Posted 11 March 2006 - 07:23 PM
The simplest solution would be to use the include() function to add your menu to every page. Then changing your menu would automatically update all your site's pages.
Posted 11 March 2006 - 07:42 PM
Posted 11 March 2006 - 08:19 PM
<a href="contact.php">Contact Us</a><br><br> <a href="accessories.php">Accessories</a><br><br>
Then when you want the menu to show on any page, place this exactly where you want your menu to appear:
... blah blah blah page stuff <?php // add my menu include("menu.php"); ?> ... blah blah blah more page stuff
Posted 11 March 2006 - 10:03 PM
You could create a navigation frame with the links on and when those links are accessed the new page content is displayed in the main frame of the page. It would be like having your page split into two.
The code you would use to make the links appear in the new frame would be
<a href="contact.php" target="MAIN_FRAME">Contact Us</a><br><br> <a href="accessories.php" target="MAIN_FRAME">>Accessories</a><br><br>
Obviously you would substitute the MAIN_FRAME target to whatever you call your frame!
I know it doesn’t use php but it’s by far the easiest way to do what you’re doing!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users