i have found out how to do it.......... so here is a little tut.......
================================================== ===========
================================================== ===========
<?php
function GetQuery($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType)
{
case "text":
$theValue = ($theValue != "") ? $theValue : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
switch (GetQuery($_GET['
ver_name'], "text"))
{
case "NULL":
include("
error.php");
break;
case "
velue":
include("
/contenturl.php");
break;
default:
include("
error.php");
break;
}
?>
================================================== ===========
================================================== ===========
ver_name: the id you want for the hook, so if it was "lollys" then the hook would look like this...
pagename.php?
lollys=bleh
error.php: is the page that is dissplayed if theres a problem, like if somone entered a wrong velue, one that was not hooked.
velue: is the end peace, eg: pagename.php?ver_name=
velue
so you can have diffrent pages for diffrent velues,
/contenturl.php: is the location of the content file of the page, this file will have all of the page content in it, so after the script reads whats in the url bar it will know where the content its ment to dissplay is.
to add more pages or more options, just copy and paste
case "
velue":
include("
/contenturl.php");
break;
under its self, change the velues, you can copy them as many times as you want, here is a full finshed version:
Code:
<?php
function GetQuery($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType)
{
case "text":
$theValue = ($theValue != "") ? $theValue : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
switch (GetQuery($_GET['pagenumber'], "text"))
{
case "NULL":
include("error.php");
break;
case "1":
include("directory/page1.php");
break;
case "2":
include("directory/page2.php");
break;
case "3":
include("directory/page3.php");
break;
case "hiddenpage":
include("directory/so_top_secret.php");
break;
default:
include("error.php");
break;
}
?>
if anyone needs anyhelp understanding this, email me, or add my msn
killjoy.j@ihug.co.nz