./ on server?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Muffinthief
    New Member
    • May 2007
    • 51

    ./ on server?

    I recently developed a website for my school. I was working off localhost for the development. When time came to upload the server we had didn't accept "./" or "../" as soft paths. Am I doing something wrong? Is there anyway to solve this?

    Thanks.
  • Muffinthief
    New Member
    • May 2007
    • 51

    #2
    If I'm on a windows server do I have to use ".\" instead of "./"? Just a thought...

    Comment

    • ak1dnar
      Recognized Expert Top Contributor
      • Jan 2007
      • 1584

      #3
      Could you please explain "soft paths" ?
      Are you talking about relative path? give some example links (Image,File) which is not working in your HTML/PHP codes.

      Comment

      • nathj
        Recognized Expert Contributor
        • May 2007
        • 937

        #4
        Originally posted by Muffinthief
        If I'm on a windows server do I have to use ".\" instead of "./"? Just a thought...
        If you mean relative paths so using '../' to go back up the directory tree and then adding the rest of the path to come down the tree you should be able to use either '/' or '\' for Windows - it sorts it out for you - I think.

        If it's *nix box then you need to use '/'.

        So I recommend you use '/' as that should work regardless of server OS. To give an example if you have a site 'www.myschool.c om' and you want to go to the images directory you could do so with 'image'mypictur e.jpg' to get that file.

        If you are in a sub directory say 'www.myschool.c om/pages/classes.php' and you want to get an image from the image directory, which is at the same level as the pages directory then '../image/classpicture.jp g' should do the trick.

        It is definitely a double'.' to go back up the tree though. The simple solution might be to use absolute paths rather than relative ones anyway.

        Cheers
        nathj

        Comment

        • Muffinthief
          New Member
          • May 2007
          • 51

          #5
          I'm doing "is_dir('./blogs')" and it's returning false.

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by Muffinthief
            I'm doing "is_dir('./blogs')" and it's returning false.
            Say you are currently in a file (www/dir1/dir2/dir3/test.php) this file has been included by www/dir1/dir2/startup.php and this has been included by www/dir1/run.php

            Using './' in test.php will then refer to www/dir/
            './' takes you to where the 'parent' file is.

            Just to clear up any confusion. So make sure there is a directory called 'blogs' whereever your php script starts.

            Comment

            • Muffinthief
              New Member
              • May 2007
              • 51

              #7
              This all works when I run on localhost. Would it be different on the server?

              Comment

              • Muffinthief
                New Member
                • May 2007
                • 51

                #8
                Ok strike that, I've fixed that problem, but now I have another. I can't read or write files on the server. I'm assuming that the permissions just aren't letting me, but I think my server doesn't support chmod. Should I just look for a new server, or is there a way around this?

                Comment

                Working...