|
The almighty page inside a page skill - used by loads of people, but in different ways, this is the easiest.
<?php
if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
$mode = htmlspecialchars($mode);
?>
Basically what is happening there is the page looks for ?mode=, to change this, simply change the value within $HTTP_GET_VARS[''] - simple.
Next we check what the user put in fits into the criteria, in this case - it can only be the exact word 'mode', and then we format it using something...
To make a target page show up we will use the fasinatingly simple...If statement!
<?php
if ( $mode == 'target' ){
include('target.php');
} else {
include('failed.php');}
} // end the HTTP_GET_VARS section.
?>
This last section check to see what you put after the ?mode= , in this example, you have to put target, otherwise it loads an error page - or whatever you want really. If you did put target in, then it loads up that page.
That script is really really simple to use, edit and make better, just by adding && after all the $mode == 'target and creating another variable like the mode, you can go further and have index.php?mode=target&option=newer
|