Echo a directory name and not the path

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Echo a directory name and not the path

    For a first creation I made a default index page for all the
    tutorials/test PHP stuff (tables, links, etc). Now I want each index
    to be named the same as their respective directory but I can't seem to
    find a way to do this without including the path.

    Can somebody please point me in the right direction
    Jethro Guest

  2. Similar Questions and Discussions

    1. cfindex using recursive directory query and type=path
      Using ColdFusion 6. I generated a query containing a list of the directories I want to index (www.cflib.org has a cfdirectory UDF). I now have a...
    2. CLI - Directory path from $_SERVER
      I need the path of the script that is running. Unfortunately it is not in the $_SERVER array when running a script through the CLI. Through a...
    3. Can you turn off safe_mode for a global alias path or directory?
      Hi, I'm using the FreeBSD Port mod_php4-4.3.1 I have lots of name-based virtual sites which all have: php_admin_value open_basedir...
    4. OS X Directory Path (k)
      I'm trying to write the correct Lingo to access the QuickTime.pkg installer on the CD I'm working on. on mouseDown me open...
    5. linking with home directory path
      I have a script that contains style sheets and I can't seem to link it on my Windows 2000 IIS server. It works perfectly fine on my Windows XP IIS...
  3. #2

    Default Re: Echo a directory name and not the path

    "Jethro" <none@here.com> wrote in message
    news:gtosj0lh61bvbffp2j4s1m80kt83rv0f0b@4ax.com...
    > For a first creation I made a default index page for all the
    > tutorials/test PHP stuff (tables, links, etc). Now I want each index
    > to be named the same as their respective directory but I can't seem to
    > find a way to do this without including the path.
    >
    > Can somebody please point me in the right direction
    For starters, try producing a clearer explanation, perhaps with some
    examples. I, for one, have no idea what you are trying to convey.

    - Virgil


    Virgil Green Guest

  4. #3

    Default Re: Echo a directory name and not the path

    In article <30D%c.17868$T44.7109@newssvr22.news.prodigy.com >,
    [email]vjg@DESPAMobsydian.com[/email] says...
    > "Jethro" <none@here.com> wrote in message
    > news:gtosj0lh61bvbffp2j4s1m80kt83rv0f0b@4ax.com...
    > > For a first creation I made a default index page for all the
    > > tutorials/test PHP stuff (tables, links, etc). Now I want each index
    > > to be named the same as their respective directory but I can't seem to
    > > find a way to do this without including the path.
    > >
    > > Can somebody please point me in the right direction
    >
    > For starters, try producing a clearer explanation, perhaps with some
    > examples. I, for one, have no idea what you are trying to convey.
    >
    > - Virgil
    >
    >
    The way I read it ...
    tutorials/tables/index.php
    tutorials/links/index.php
    tutorials/etc/index.php
    .... and wants ...
    tutorials/tables/tables.php
    tutorials/links/links.php
    tutorials/etc/etc.php

    Solution : name the folders and files as you go along.

    Rocky

    Rocky Guest

  5. #4

    Default Re: Echo a directory name and not the path

    On Wed, 08 Sep 2004 12:35:11 GMT, "Virgil Green"
    <vjg@DESPAMobsydian.com> wrote:
    >"Jethro" <none@here.com> wrote in message
    >news:gtosj0lh61bvbffp2j4s1m80kt83rv0f0b@4ax.com.. .
    >> For a first creation I made a default index page for all the
    >> tutorials/test PHP stuff (tables, links, etc). Now I want each index
    >> to be named the same as their respective directory but I can't seem to
    >> find a way to do this without including the path.
    >>
    >> Can somebody please point me in the right direction
    >
    >For starters, try producing a clearer explanation, perhaps with some
    >examples. I, for one, have no idea what you are trying to convey.
    >
    > - Virgil
    >
    Sorry to both of you for being unclear.

    I made a PHP script that'll generate and link the contents of a
    directory with an output of HTML (organized in a tidy fashion,
    filtered/etc). I'll name the script index.php and drop it in every
    directory that has a lot of odds and ends

    What I'm looking to do is to automatically display the name of the
    directory as the title of the page (not <title>*</title> but maybe)
    but just some fill to give the page a more balanced and complete look

    echo getcwd() . "\n"; ----will give me /var/www/html/stuff/Forms and I
    want to look from the right for the first / and use everything from
    the right of that. Unless there's a better way.


    Sorry again for being unclear

    Jethro Guest

  6. #5

    Default Re: Echo a directory name and not the path

    try this:

    dirname(__FILE__)

    "Jethro" <none@here.com> wrote in message
    news:5i5uj0h23a6gn14917j1n9mvhqmv028sjj@4ax.com...
    > On Wed, 08 Sep 2004 12:35:11 GMT, "Virgil Green"
    > <vjg@DESPAMobsydian.com> wrote:
    >
    > >"Jethro" <none@here.com> wrote in message
    > >news:gtosj0lh61bvbffp2j4s1m80kt83rv0f0b@4ax.com.. .
    > >> For a first creation I made a default index page for all the
    > >> tutorials/test PHP stuff (tables, links, etc). Now I want each index
    > >> to be named the same as their respective directory but I can't seem to
    > >> find a way to do this without including the path.
    > >>
    > >> Can somebody please point me in the right direction
    > >
    > >For starters, try producing a clearer explanation, perhaps with some
    > >examples. I, for one, have no idea what you are trying to convey.
    > >
    > > - Virgil
    > >
    > Sorry to both of you for being unclear.
    >
    > I made a PHP script that'll generate and link the contents of a
    > directory with an output of HTML (organized in a tidy fashion,
    > filtered/etc). I'll name the script index.php and drop it in every
    > directory that has a lot of odds and ends
    >
    > What I'm looking to do is to automatically display the name of the
    > directory as the title of the page (not <title>*</title> but maybe)
    > but just some fill to give the page a more balanced and complete look
    >
    > echo getcwd() . "\n"; ----will give me /var/www/html/stuff/Forms and I
    > want to look from the right for the first / and use everything from
    > the right of that. Unless there's a better way.
    >
    >
    > Sorry again for being unclear
    >

    Charles Pelkey Guest

  7. #6

    Default Re: Echo a directory name and not the path

    Got it with your info...


    Thanks

    On Wed, 08 Sep 2004 22:29:32 GMT, "Charles Pelkey"
    <c.e.pelkey@sbcglobal.net> wrote:
    >try this:
    >
    >dirname(__FILE__)
    >
    >"Jethro" <none@here.com> wrote in message
    >news:5i5uj0h23a6gn14917j1n9mvhqmv028sjj@4ax.com.. .
    >> On Wed, 08 Sep 2004 12:35:11 GMT, "Virgil Green"
    >> <vjg@DESPAMobsydian.com> wrote:
    >>
    >> >"Jethro" <none@here.com> wrote in message
    >> >news:gtosj0lh61bvbffp2j4s1m80kt83rv0f0b@4ax.com.. .
    >> >> For a first creation I made a default index page for all the
    >> >> tutorials/test PHP stuff (tables, links, etc). Now I want each index
    >> >> to be named the same as their respective directory but I can't seem to
    >> >> find a way to do this without including the path.
    >> >>
    >> >> Can somebody please point me in the right direction
    >> >
    >> >For starters, try producing a clearer explanation, perhaps with some
    >> >examples. I, for one, have no idea what you are trying to convey.
    >> >
    >> > - Virgil
    >> >
    >> Sorry to both of you for being unclear.
    >>
    >> I made a PHP script that'll generate and link the contents of a
    >> directory with an output of HTML (organized in a tidy fashion,
    >> filtered/etc). I'll name the script index.php and drop it in every
    >> directory that has a lot of odds and ends
    >>
    >> What I'm looking to do is to automatically display the name of the
    >> directory as the title of the page (not <title>*</title> but maybe)
    >> but just some fill to give the page a more balanced and complete look
    >>
    >> echo getcwd() . "\n"; ----will give me /var/www/html/stuff/Forms and I
    >> want to look from the right for the first / and use everything from
    >> the right of that. Unless there's a better way.
    >>
    >>
    >> Sorry again for being unclear
    >>
    >
    Jethro Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139