PHP :: linking to within the same page

They have: 15 posts

Joined: Feb 2003

Here is my problem:

I have a single page with a table devided into 2 sections (say top and bottom), one for links and the other for information.

When I click on any of the various links above, I would like the information relative to it (right now sitting in a table in it's own html file) to replace whatever is in the lower 'info' section. When I click another link, I'd like the info relative to it, to appear in the lower info section.

____________________
| link 1 - link 2 - link 3 |
|___________________|
| info here |
|___________________|

I have no idea how to do this. I do not want to use any frames (incl. iframes). HELP!

In other words, I want the links to fill the info area with new content w/o using frames and without reloading the page.

Any help would be appreciated.

Thank you.

They have: 20 posts

Joined: Feb 2003

They have: 15 posts

Joined: Feb 2003

That's the classic example of header/footer correct?

That reloads the page however, if I am not mistaken.

I am interested in a script that can add or remove information (a table in this case) dynamically.

I thought maybe includes can do it, but I stil do not know how.

Busy's picture

He has: 6,151 posts

Joined: May 2001

You'd need Javascript or DHTML to do that but it wont work on all browsers, whats wrong with the reload option?
With server side you can have a whole site run off one page (not always advised) by setting variables to choose what to display

index.php?link=1 would display link 1's details
index.php?link=2 would display link 2's details etc but the page would have to reload each time but this method does work on all browsers

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

Alistapart/ covers that, and i'm currently write a tutorial that covers that too, go take a look.

They have: 15 posts

Joined: Feb 2003

I'll have a look at the tuts given.

The reason I do not want the reload is because this page is one half of a frameset. It also incorporated dhtml in it's content management, so adding more layers would only complicate things.

dk01's picture

He has: 516 posts

Joined: Mar 2002

Well I don't think there is any other way. I think dhtml is your only real option here.
-dk

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.