View Full Version : A simple yet complex PHP thing: Loading content with same layout...
RCTFORME
09-06-2002, 01:47 AM
Ok, what I want to do, like so many other sites I've seen, is have a site with 1 layout, and content and all that crud.
But I notice that with sites that use PHP, they have content that simply loads with 1 layout...
I want to know how to set that up.
So how do you???
I have frontpage (if that helps at all).
Thank you very much ^_)^
(This has probably been asked like a million times, but if it wasn't, well that's good then)
mordred
09-06-2002, 09:13 AM
Can you refine your question as to what you mean with "1 layout"? I suppose your talking about template engines, or do you mean portal applications, like PHPNuke?
About using FrontPage... perhaps a more text-oriented editor would be better if you plan to learn PHP.
RCTFORME
09-06-2002, 05:19 PM
Well I mean sites like this:
http://www.pokemon706.com/
They have it set so that when you click a link to content, it opens up on the index page ^_)^ like it says index.php then when you load any of the content pages, the URL says like
http://www.pokemon706.com/?id=sitegoals (which is an example of one of their links)
So I'm assuming it loads the requested content on their index.php page ^_)^
I've tried asking them myself but they haven't responded to my mails
mordred
09-06-2002, 07:01 PM
Well, we can't look into the backend scripts they use on the site mentioned, but I guess they are just looking up what was passed as GET parameter (the things behind the question mark in the URL) and according to that serve different content.
As an example, look at this:
if (isset($_GET['id'])) {
switch ($_GET['id']) {
case "contentA":
require_once "fileA.php";
break;
case "contentB":
require_once "fileB.php";
break;
case "contentC":
require_once "fileC.php";
break;
default:
require_once "index.php";
}
}
If you know call the document like index.php?id=contentA, then the responding content served would be that of fileA.php, because that's what get included by the script on this condition.
Hope that illustrates my point clearly enough.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.