PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun Dec 08, 2019 10:37 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 60 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: Thu Oct 13, 2005 9:22 am 
Offline
DevNet Master
User avatar

Joined: Mon Sep 19, 2005 6:24 am
Posts: 3587
Location: London
This way is better:

Syntax: [ Download ] [ Hide ]
<?php



$pages = array('main.php', 'blah.php', 'foo.php');



isset($pages[$_GET['p']]) ? include($pages[intval($_GET['p'])]) : include('default.php');



?>


Last edited by Jenk on Thu Oct 13, 2005 9:30 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 9:25 am 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
pssst.. should check for the file's existance too, just in case. ;)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 9:31 am 
Offline
DevNet Master
User avatar

Joined: Mon Sep 19, 2005 6:24 am
Posts: 3587
Location: London


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 5:17 pm 
Offline
Forum Commoner
User avatar

Joined: Thu Jul 10, 2003 11:11 pm
Posts: 81
Location: Orland Park, IL


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 5:38 pm 
Offline
DevNet Master
User avatar

Joined: Sun Jan 21, 2007 12:06 am
Posts: 4135


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 6:24 pm 
Offline
Forum Commoner
User avatar

Joined: Thu Jul 10, 2003 11:11 pm
Posts: 81
Location: Orland Park, IL


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 6:58 pm 
Offline
Forum Regular
User avatar

Joined: Wed Jul 30, 2003 3:29 am
Posts: 875
Location: Sweden


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 8:40 pm 
Offline
Forum Commoner
User avatar

Joined: Thu Jul 10, 2003 11:11 pm
Posts: 81
Location: Orland Park, IL


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 8:49 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 8:54 pm 
Offline
Forum Commoner
User avatar

Joined: Thu Jul 10, 2003 11:11 pm
Posts: 81
Location: Orland Park, IL


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 9:01 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 9:06 pm 
Offline
Forum Commoner
User avatar

Joined: Thu Jul 10, 2003 11:11 pm
Posts: 81
Location: Orland Park, IL


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 9:13 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 9:17 pm 
Offline
Forum Commoner
User avatar

Joined: Thu Jul 10, 2003 11:11 pm
Posts: 81
Location: Orland Park, IL


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 07, 2007 9:38 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 60 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group