Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    553
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Referencing parent directory?

    An elementary question, but I am trying to link to a page that is in the directory (the parent of the directory where this php script resides) above. I tried the link like so, but I guess I am not remembering correctly, because it did not work...

    echo "<a href=\".../special.php3\">Click here to go</a>"

    G

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your only error is a tiny typo:

    echo "<a href=\".../special.php3\">Click here to go</a>"

    That should be only two dots before the slash, not three.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    553
    Thanks
    0
    Thanked 0 Times in 0 Posts
    mordred,

    Thanks very much. I don't think I would ever have stumbled on that just trying myself.

    G

  • #4
    Regular Coder
    Join Date
    May 2002
    Location
    London, England
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    for reference, .. refers to the parent directory and . refers to the current directory.

    To go up two directories, you would use ../../file.php

    Jee
    Jeewhizz - MySQL Moderator
    http://www.sitehq.co.uk
    PHP and MySQL Hosting

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Posts
    553
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Gotcha, thanks.


  •  

    Posting Permissions

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