Web Analytics Made Easy -
StatCounter Getting directory name - CodingForum

Announcement

Collapse
No announcement yet.

Getting directory name

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting directory name

    How can I get the name of the current directory a user is viewing?

  • #2
    PHP Code:
    $url explode("/",$PHP_SELF);
    $filename $url[sizeof($url)-1];
    $dir $url[sizeof($url)-2]; 
    Doesn't matter, found this

    Comment


    • #3
      or ...

      PHP Code:
      <?
      echo dirname ($_SERVER[PHP_SELF]); 
      ?>
      resistance is...

      MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

      Comment


      • #4
        Thanks Is your way less stress on the server too?

        Comment


        • #5
          without groping through the Zend source I am unsure how dirname() is handled internally but I would assume it would have to be more efficient ??
          resistance is...

          MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

          Comment

          Working...
          X