PHP script for sections

 
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials
View previous topic :: View next topic  

Was this helpful?
Yes
100%
 100%  [ 1 ]
A little
0%
 0%  [ 0 ]
No
0%
 0%  [ 0 ]
Total Votes : 1

Author Message
k1ll3rdr4g0n
-


Joined: 04 Jul 2004
Posts: 609

PostPosted: Thu Sep 09, 2004 9:59 pm    Post subject: PHP script for sections Reply with quote

This script will allow you to make sites like phpnuke and forums that have something like:
http://www.something.com/index.php?section=something&whatever



Code:
<?php
// Here we will find the text after ?section=
$id = $_GET["section"];
//Here we will find out which even it will excute
  switch( $id )
{
// will excute if it is ?section=news
case "news":
$title = "news";
$main = 'some web code here';
include("yoursite.php");
// This means for the script to stop
break;
// will execute if ?section=something
case "something":
$somevariable = '';
include("yoursite.php");
break;
//This happens when there is nothing entered
//or it didnt excute any others
default:
$content = 'welcomem.php';
include("main1.php"); break;
}
?>


And to initate the code in your site do...

Code:
<?php
echo $variable;
?>


If anyones intrested I based some of this code off TRUSTpunks download script.[/code]
_________________
Back to top View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB phpBB Group