Most people that are new to php always ask me "how do you mask .php files with any tag you want, the most common w/e.php?id=122323"
basically all this script does is mask the other php files like news.php and will change it to index.php?id=news, so instead of having
http://www.yourdomain.com/news.php you would have http:/www.yourdomain.com/index.php?id=news
http:/www.yourdomain.com/index.php?id=forums
http:/www.yourdomain.com/index.php?id=index
and so on and so fourth
well in this im going to show you how to do this :
First of all open up your favorite php coder or editor program "I recommend Dreamweaver, just cause its the best program ever"
Next make a new PHP file, click on the code area and type the following code
Code:
<?php
/* verify the validity of GET var page
if not set, do a default case */
if(isset($HTTP_GET_VARS['id']))
{
$p = $HTTP_GET_VARS['id'];
}
else
{
$p = 'index';
}
switch($p)
{
case 'index':
require('index.php.php');
break;
case 'news':
require('news.php');
break;
case 'what you want':
require('the file you want.php');
break;
default:
exit('Wrong parameter for file inclusion');
}
?> with this code you can add it to any PHP script and it wil mask your urls to .php?id=whateverthefilenameis
use this code in any php file and when you go to put links in a menu like index.php and forums.php and news.php you dont need to do that now just type index.php?id=index or index.php?id=forums, so this makes it easy for viewers as well cause they wont have to remember all the page names just the id= tag :
to change it to say something else instead of ?id= do the following
Code:
if(isset($HTTP_GET_VARS['TYPE WHATEVRE YOU WANT HERE']))
{
$p = $HTTP_GET_VARS['TYPE THE EXACT SAME THING AS ABOVE']; there pretty simple, eh?