This is the right section.
Has anyone got a tutorial or some information on PHP Includes.
Thanks,
Adam Rose

This is the right section.
Has anyone got a tutorial or some information on PHP Includes.
Thanks,
Adam Rose
unitedstates,canada,mexico,panama,haiti,jamaica,pe ru,republicdominian,cuba,caribbean,greenland and el salvadour too.
puertorica,colombia,venezuela,honduras,guyana and still, guatamala,bolivia then argentina and ecuador,chile,brazil.
costarica,belize,nicaragua,bermuda,bahamas,tobago, sanjuan,paraguary,uruguay,suriname,frenchguiana,ba rbados and guan.
norway and sweden and iceland and finland and germany now one piece, switzerland,austrira,czechoslovakia,italy,turkey and greece.
www.php.net/include
PHP Code:include("file.ext");
Last edited by Luckyrare; 26-11-2006 at 03:59 PM.
Thanks,
I need a little more than that though![]()
Last edited by tekni; 26-11-2006 at 04:03 PM.
unitedstates,canada,mexico,panama,haiti,jamaica,pe ru,republicdominian,cuba,caribbean,greenland and el salvadour too.
puertorica,colombia,venezuela,honduras,guyana and still, guatamala,bolivia then argentina and ecuador,chile,brazil.
costarica,belize,nicaragua,bermuda,bahamas,tobago, sanjuan,paraguary,uruguay,suriname,frenchguiana,ba rbados and guan.
norway and sweden and iceland and finland and germany now one piece, switzerland,austrira,czechoslovakia,italy,turkey and greece.
This is a bit of code i made: Hope thats what u want!
<?php
// Assign the requested page to a shorter variable for simplicity.
// The value of $_GET["page"] will be obtained from index.php?page=RIGHT_HERE
$p = $_GET["page"];
// Check for bad requests. This is necessary to prevent the wrong files
// from being included. This is a security measure.
if (strpos($p,"..")) {
// A bad request has been made, exit immediately. Do not proceed
// with the inclusion.
// strpos($p,"..") checks for presence of ".." in the page request.
// ".." can be used to access files in parent directories
die("Bad page request");
}
// File to include.
// this will be something like '/www/page.php'. If $p is empty, fall back
// main.php. THIS FILE MUST EXIST, otherwise bad things will happen.
if (!$p) $p = "main";
$content_file=$_SERVER["DOCUMENT_ROOT"]."/".$p.".php";
// See if $content_file exists. If it does not, redirect to the homepage.
if (!file_exists($content_file)) {
header("Location: {$_SERVER["PHP_SELF"]}");
exit();
}
// At this point everything is fine. Set the appropriate title and then
// include the files.
// Syntax: $variable = (condition) ? value_if_true : value_if_false;
$title = ($p) ? "$p - My Site!" : "Main page - My Site!";
include("header.php");
include($content_file);
include("footer.php");
?>
-cries-
I cba to learn php - I never want to.
I just need a code or whatever.
+Rep anywho.
unitedstates,canada,mexico,panama,haiti,jamaica,pe ru,republicdominian,cuba,caribbean,greenland and el salvadour too.
puertorica,colombia,venezuela,honduras,guyana and still, guatamala,bolivia then argentina and ecuador,chile,brazil.
costarica,belize,nicaragua,bermuda,bahamas,tobago, sanjuan,paraguary,uruguay,suriname,frenchguiana,ba rbados and guan.
norway and sweden and iceland and finland and germany now one piece, switzerland,austrira,czechoslovakia,italy,turkey and greece.
Want to hide these adverts? Register an account for free!