
May 21st, 2004
10:21 PM
Re: Tutorial: page.php?page=blah / query strings / easy template tutorial (UPDATED)
Originally posted by Phil
Way one, if you intend to have other query string variables besides just ?page
<?php
if( isset($_GET['news']) and !defined('PAGE_LOADED') ) {
include 'pages/news.php';
define ('PAGE_LOADED', '');
}
if( isset($_GET['portfolio']) and !defined('PAGE_LOADED') ) {
include 'pages/portfolio.php';
define ('PAGE_LOADED', '');
}
if( isset($_GET['forum']) and !defined('PAGE_LOADED') ) {
define ('PAGE_LOADED', '');
header("Location: forum.php");
}
?>
great stuff for a php novice like myself! but, in the above example, how do I add the default page? and what does header ("Location: forum.php") do?
thanks 

May 22nd, 2004
02:32 AM
Neverside Newbie
Status: Offline!
redirects to the specified direction, in this case is "forum.php"
___________________
WARNING: It's in Spanish.

May 19th, 2005
11:00 PM
with Mr. Jones
Status: Offline!
Bump; we need it
___________________
http://www.philbrodeur.com - Expert PHP Development and Tutorials

May 23rd, 2005
01:36 AM
i do my crosswords in pen
Status: Offline!
Are you ever going to make a tutorial about URLs like index.php?article=23&page=4 ?

September 17th, 2005
12:23 AM
Neverside Newbie
Status: Offline!
<?php
elseif (!isset($_SERVER['QUERY_STRING'])) {
include 'includes/home.php';
}
?>
sorry about replying to such an old topic, but i have found that code to work for the default page.
___________________
http://www.ewker.com