In my main content div I have this:
So, in my nav div, what would code would I have to put if I wanted to open say news.php into the main content div?PHP Code:<?php include("home.php"); ?>
+Rep to any helpers.

In my main content div I have this:
So, in my nav div, what would code would I have to put if I wanted to open say news.php into the main content div?PHP Code:<?php include("home.php"); ?>
+Rep to any helpers.
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.
Are you using iframes, otherwise you just replace home.php with news.php and save it.
I know how to work iframes, but iframes are crap and should be blown up.
I'm trying to figure out how the hell to use includes.
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.
Here is sommert i wrote: Hope it is what u need!
<?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");
?>
Last edited by Florx; 26-11-2006 at 04:30 PM.
No tutorial on how to use it?
Where did you steal that from?
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.
http://f0rked.com/articles/dynamism
Lol i didnt write it. Well i did but i didnt w.e. here ^
Use the easier way, where you get page.php?id=whatever.
I'll try and find you a tut.
Thanks dan.
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.
http://f0rked.com/articles/dynamism go there
The code is very simple...Code:<?php switch( $_GET[’id’] ) { default: include ‘main.htm’; break; case ‘community′ : include ‘community.htm’; break; } ?>
You can copy the 3 lines as many times as you wish (the case, include and break) for more pages.
The top one which says deafault it the page you wish to load when the site is loaded.
You can change the bit at the top that says id to whatever you want, it will appear in the url, e.g. index.php?id=community.
Put the code in your content area.
Off topic: 3 pure for your layout?
Want to hide these adverts? Register an account for free!