php - use name of a directory as a variable -


i have file thats displayed on user page in iframe, need content in iframe name of users folder variable.

to better explain, have /logins/users/foo/foo.php foo.php embeds universal file user pages use called skin.php in /logins/skins/skin.php universal page changes skin displays based on variable $user need $user whatever folder name page being viewed in.

is there way this? can on user page using

<link rel="stylesheet" type="text/css" href="/css/index.css" /> <?php     $path = dirname($_server['php_self']);     $position = strrpos($path,'/') + 1;     $user= substr($path,$position);     $root="/";  include ($_server['document_root'].'/menu/nav.php');  echo '<iframe src="/logins/skin/index.php?user=$user"/>' ?> 

is there anyway pass variable iframed content?

sure can build query string parameter..

echo "<iframe src="http://your/path/to/iframe.php?user=$user"/> 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -