nashsaint Posted April 18, 2009 Share Posted April 18, 2009 This is very common on php sites but i dont know how to do it. Ive already searched for this but couldn't find the solution. Like this site for example it uses this link to access profile page without displaying the actual php filename. http://www.phpfreaks.com/forums/index.php?action=profile How should i do this? Say, i have an index.php and want to access contact.php without displaying the actual location on hover or address bar. help is much appreciated. thanks. Link to comment https://forums.phpfreaks.com/topic/154629-linking-to-page-based-on-url/ Share on other sites More sharing options...
jackpf Posted April 18, 2009 Share Posted April 18, 2009 It does, the filename is index.php Are you talking about apache mod_rewrite? Link to comment https://forums.phpfreaks.com/topic/154629-linking-to-page-based-on-url/#findComment-813088 Share on other sites More sharing options...
nashsaint Posted April 18, 2009 Author Share Posted April 18, 2009 the index.php yes but the profile.whatever.php is not known. what is shown is the source page which is the index.php. Link to comment https://forums.phpfreaks.com/topic/154629-linking-to-page-based-on-url/#findComment-813096 Share on other sites More sharing options...
jackpf Posted April 18, 2009 Share Posted April 18, 2009 Probably used include()? Link to comment https://forums.phpfreaks.com/topic/154629-linking-to-page-based-on-url/#findComment-813097 Share on other sites More sharing options...
Pawn Posted April 18, 2009 Share Posted April 18, 2009 what is shown is the source page which is the index.php. if($_GET['action']=="profile") { include("profile.php"); } Link to comment https://forums.phpfreaks.com/topic/154629-linking-to-page-based-on-url/#findComment-813100 Share on other sites More sharing options...
web_master Posted April 18, 2009 Share Posted April 18, 2009 <?php // Content if($_GET['profile'] == ''){ $profile = 'basicopenfile'; } else { $profile = $_GET['profile']; } ?> <?php // Include contents $file_name = 'contents/'.$profile.'.php'; include($file_name); ?> profile.php file is in "contents" directory Link to comment https://forums.phpfreaks.com/topic/154629-linking-to-page-based-on-url/#findComment-813111 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.