title: use name of a directory as a variable
body: <p>I have a file thats displayed on a user page in an iframe, but I need the content in this iframe to get the name of the users folder as a variable.</p>
  
  <p>to better explain, I have /logins/users/foo/foo.php
  foo.php embeds a universal file all user pages use called skin.php in /logins/skins/skin.php
  the universal page changes the skin it displays based on a variable $user
  i need $user to be whatever the folder name is that the page being viewed is in.</p>
  
  <p>is there any way to do this? I can do it on the user page itself using </p>
  
  <pre><code>&lt;link rel="stylesheet" type="text/css" href="/css/index.css" /&gt;
  &lt;?php
      $path = DIRNAME($_SERVER['PHP_SELF']);
      $position = STRRPOS($path,'/') + 1;
      $user= SUBSTR($path,$position);
      $root="/";
  
  include ($_SERVER['DOCUMENT_ROOT'].'/menu/nav.php');
  
  echo '&lt;iframe src="/logins/skin/index.php?user=$user"/&gt;'
  ?&gt;
  </code></pre>
  
  <p>is there anyway to pass that variable to the iframed content?</p>