k1ll3rdr4g0n -
Joined: 04 Jul 2004 Posts: 609
|
Posted: Thu Sep 09, 2004 9:59 pm Post subject: PHP script for sections |
|
|
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] _________________
|
|