Closed Thread Icon

Topic awaiting preservation: PHP Navagation (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12311" title="Pages that link to Topic awaiting preservation: PHP Navagation (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: PHP Navagation <span class="small">(Page 1 of 1)</span>\

 
dmstiner
Bipolar (III) Inmate

From:
Insane since: Mar 2002

posted posted 07-15-2002 04:20

Here is my problem, I am developing a website and the client only wants links for the main pages to be displayed on the home page (Services, Products etc) when a client navigates to one of these main sections they should then be presented with links for the subcatagories i.e. the customer clicks products on the main page and is taken to the products section of the site, now links to their products are displayed in addition to the links for the main sections. Now what I would like to happen is when a user clicks on a product only one section of the page reloads with information about the product and the rest of the page remains the same, as if I were using frames. I already have the site broken up into several includes, one for the header, one for navigation, one for content, one for a footer etc. so it should just be a matter of changing which include is being used in the content area of the page. I read this tutorial on webmonkey http://hotwired.lycos.com/webmonkey/99/25/index2a.html?tw=programming and I know that would work for me however I am so far along in the development of this site that it would require me to spend a ton of time reworking the site to use this technique. Does anyone have a suggestion on how I can change only one include without reloading the rest?

Here is an example of the very basic method I am using to assemble the pages so that I can work with smaller chuncks of code and update all of my pages at once:

<?
// File: index.php

INCLUDE "includes/header.inc";

INCLUDE "includes/menu.inc";

INCLUDE "includes/special.inc";

INCLUDE "includes/news.inc";

INCLUDE "includes/footer.inc";
?>

Thanks in advance for any help!

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 07-15-2002 05:11

Since PHP is server-side language, page must be reloaded if you want to change its content. If you want to dynamically change page content without reloading, you'll have to use DHTML/JavaScript combination (because it must be done on the client-side). Just do a search for "innerHTML" on DHTML/JavaScript board here, and you'll get a plenty of topics where this is discussed...


dmstiner
Bipolar (III) Inmate

From:
Insane since: Mar 2002

posted posted 07-15-2002 05:23

Thanks for the quick reply Mr. Max. I will look into the DHTML solution and just go with the whole page reloading for now, its not a big problem currently but I'd like to look after their bandwidth as traffic increases Thanks again.

« BackwardsOnwards »

Show Forum Drop Down Menu