Reply
PHP address mask tutorial
Old 02-25-2006, 09:56 PM PHP address mask tutorial
Junior Talker

Posts: 131
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
waqar is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 02-26-2006, 05:16 AM
Junior Talker

Posts: 211
nice! taken me a while to read it all but i think i understand it now. thanks man!
__________________
http://tsh.xeeblo.net/1.gif
Quahog Crazy is offline
Reply With Quote
View Public Profile
 
Old 02-27-2006, 12:13 AM
Junior Talker

Posts: 131
no problem i m here to help al my friends
waqar is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP address mask tutorial
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11399 seconds with 13 queries