frames and stuff

Soldato
Joined
25 Sep 2003
Posts
3,750
Location
Manchester
Ok, this is really basic but I've forgotten how to link a hyperlink in to a frame. So what i'm trying to do is have a menu bar and then an area on the main page which will change depending on what's clicked on the menu.

So, any pointers :o
 
ok, I've scrapped the idea of frames, to be honest I wasn't sure what I wanted to use. Can someone post a simple example on how to have a hyperlink change an area on an html page by "importing" from another html file.

i.e.

Orange - Apple
---------------

TEXT AREA


So, by clicking Orange it would get orange.html and put it in the TEXT AREA and then if the user clicked Apple it would change the text area to apple.html

thanks for any help been looking around the internet for examples but can't find any straight forward ones.
 
Last edited:
I think what you wish to do requires server-side includes, although im sure there might be another way.

Doing it with PHP would be something along the lines of:

index.php
Code:
<?

   include 'nav.html';

   switch( $_GET['page'] )
   {
      Case 'apple':
         include 'apple.html';
         break;
      Case 'pear':
         include 'pear.html';
         break;
      default: //This shows when nothing else does - Ie, no navigation.
         include 'home.html';
         break;
   }

?>

nav.html
Code:
   <ul>
      <li><a href="?page=apple" title="apple">Apple</li>
      <li><a href="?page=pear" title="pear">Pear</li>
   </ul>
 
Last edited:
Back
Top Bottom