note 22036 added to function.include
| From: | z_rudy at hotmail dot com | Date: | Tue, 04 Jun 2002 15:33:09 +0000 |
| Subject: | note 22036 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31433@lists.php.net to get a copy of this message | ||
To easily put a template to your site, and change the design easily. Read this note: (already
discussed but now in another way)
Design Page:
DO NOT PUT A TITLE TAG IN THE HEAD
Add this wherever you want text to be displayed:
<?php
$success = @include("pages/$page.php");
if (!$success) { include("pages/home.htm"); }
?>
This will include the file (pages/$page.php) where $PAGE should be specified somewhere (in the URL).
If nothing was specified, it will automatically include the PAGES/HOME.HTM file.
Change the paths according to your structure.
In the contents page, simply type the text without formatting or by using style names (although they
aren't available in the contents page, but they should be available in the design page). The
style or CSS of the design page will be applied to the contents page.
Also, the title of the contents page will take place of the title of the design page since no title
tag was defined.
the url would be:
http://mysite.com/view.php?page=credits
VIEW.PHP is the design page's name.
Comments are welcome!
--
http://www.php.net/manual/en/function.include.php
http://master.php.net/manage/user-notes.php?action=edit+22036
http://master.php.net/manage/user-notes.php?action=delete+22036
http://master.php.net/manage/user-notes.php?action=reject+22036