Web Designer/Developer, Storyteller and Lover of Technology

I'm a web designer/developer, writer and animator living in Birmingham Ala. I have been working in the web design/development field for 15 years. I am a founding member of the writing and animation team 5 Guys in a Garage who started JabTV.com. I have worked for various internet and media companies over the years including the now defunct Hecklers.com and al.com.

Find a files server path when programming in PHP

If you ever need to find a files path when programming in PHP. All you need to do is drop the below code in a text file called path.php.

<?php $p = getcwd(); echo $p; ?>

Put it in the same directory as the file whose path you need and go to it in your web browser.

http://www._yourwebname_.com/_thedirectorythefileisin_/path.php

You will get back something like this.

C:\Websites\_yourwebname_\_thedirectorythefileisin_

So now you know the server path to the file you need.

Simple.

Be Sociable, Share!

    2 Responses to “Find a files server path when programming in PHP”

    Leave a Reply