Thread: Dynamic URLs
View Single Post
Old 02-09-2006, 01:48 PM   #7 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
He wants to know how to make a dynamic page pressence, achieved due to a parsed $_GET argument, which resembles what you can achieve with mod-rewrite, only by having a "dynamic" page which has a switch() or if/else way of matching up against the parsed $_GET variabel.

Something like:
PHP Code:
<?php
$_url 
$_GET['page'];
if(
$_url == "main")
   include(
"main.php");
elseif (
$_url == "contact")
  include(
"contact.php");
else
  include(
"default.php");
?>
Which can be rewritten to a more "dynamic presentation" with a few hoops.
PHP Code:
<?php
$_url 
$_GET['page'];
if( 
is_file($_url ".php") )
  include (
$_url ".php");
else
  include (
"default.php");
?>
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote