Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP ?page= 1

Status
Not open for further replies.

benkov

Programmer
Jun 16, 2004
13
GB
I have a website which uses tables in html pages but updating it has becme tedious as I have to update every page each time I want to update.

I don't want to use frames as feel they look unprofessional but understand that I could use something similar in PHP whereby there is one page with the permenant content and sub pages open up in areas when the user clicks hyperlinks but they can still scroll the whole page.

I think this kind of thing is in ' format but am not sure how to do it.

Please can someone briefly explain the best way to do it. (I use Dreamweaver MX).

Thanks.

Ben
 
Not 100% sure what you are asking, but a very common way of doing what you want is by simply creating a template and then, based on the "Page" _GET variable, you include a file in the main content area.

Is that what you are talking about?

I.E.
Code:
<html>
<body>
<!-- header goes here -->
blah blah blah

<!-- Main Content Goes Here
<?php
$pages = array("page1.php","page2.php","page3.php");
include($pages[$_GET["page"]]);
?>

<!-- footer goes here -->
blah blah blah
</body>
</html>

This is very crude. For example you will probably want to enusre that the page variable is valid an in the array (i.e. isset($pages[$_GET["page"]]) )
 
Or you can do the opposite. Meaning you can use include files for the header and footer and just hard code the content. Thats the way most web applications and sites are built for those who don't want to use frames.
 
Thank you so much for your prompt reply

Hmmm... It all seems very complicated (I am a real PHP n00b)

How would I hard code the content? (I think that's what I'm trying to do.)
 
Before I try and guess what it is you want, can you be a little more specific. If you can provide a link that would be great.

By the way, hard code is simply another term for static content. I am assuming you are not using a database, so pretty much your whole site is hard-coded. But certain parts can be stored in a global location and just included in every location.
 
In the end, I have ended up making templates from DW as if I set up editable regions e.t.c. I can take the monotony out of updating.

Thank You for responding to my request and I apologise if I have put you to any unrequired effort.

Thanks.

Ben.

p.s. The website I was trying to update was (A Youth Club's Website)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top