Jump to content

Linking to page based on url?


nashsaint

Recommended Posts

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.

 

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

<?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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.