link help..

hey guys I was always wondering like how can I make or or how can I make that? lets say I have a php page named tools.php how would I make the page show to a user when he enters ? please help guys! i would appreciate it! and what is the name of these kind of links?

include $site;

or in 1 line
include $_REQUEST[‘site’].“php”;

While resago is technically correct, I would recommend a more secure way. The reason it is insecure is that it allows them to input any path they want, it can be a file that’s not even in your web directory, or even on your server.

What I would recommend is to create a “.php” file containing an array of all the sub-pages and their name, for example ‘$approved_list = Array( “contact”=>“contact.php”, “login”=>“login.php”)’ and you can include the file containing that array wherever you may need it. Then you would do…

if( in_array( $_GET[ 'site' ], $approved_list) ) {
   include( $approved_list [ $_GET[ 'site' ] ] );
} else {
   print 'No hacking for you.';

Additionally, this allows you to hide the true path of pages, for example if you have several sub-directories.


Sponsor our Newsletter | Privacy Policy | Terms of Service