PDA

View Full Version : Whats that code / tutorial for . . .



JoeComins
04-11-2006, 01:43 PM
Whats that code / tutorial for . . .

Many PHP Pages in one?

THanks


bomb-head (forum moderator) - Moved to 'Coding', please post in the correct forum.

Jackboy
04-11-2006, 01:48 PM
<?
include ("PAGE.php");
include ("PAGE.php");
include ("PAGE.php");
include ("PAGE.php");
include ("PAGE.php");
include ("PAGE.php");
include ("PAGE.php");
include ("PAGE.php");
include ("PAGE.php");
?>

JoeComins
04-11-2006, 01:56 PM
TUT - No

I mean, you can have several pages in one. Like by clicking a link, it loads a certain part of the page, minimising files and space used.

Either this, or whats the code for teh think where you click a link at it scrolls the page down for you?

I cant remember, but I know how to use a PHP Include . . .

For PHP Includes, I use:



<?php
$val = $_GET['id'];
$val .= ".php";
$dirty = array("..");
$clean = array("");
$val = str_replace($dirty, $clean, $val);

if (isset($_GET['id'])) {
if (file_exists($val)) {
include "$val";
}
else {
include "404.php";
}
}
else {
include "home.php";
}

// Include this script in your content area
// Run ?id=pagename (without .php) to view a page
?>

Mentor
04-11-2006, 02:48 PM
i wrote it ages ago so its probably pretty crapy, but http://thybag.co.uk/?p=Tutorials&ind=23

JoeComins
04-11-2006, 03:39 PM
I knew I had seen it somewhere. I jsut wanted to read up on it.

TY Carl

Want to hide these adverts? Register an account for free!