View Single Post
  #1 (permalink)  
Old 04-24-2008, 10:42 AM
livetech livetech is offline
Senior Member
238 posts this year. worth their weight in gold!
Trusted Member - And full of good stuff!
Last months UKWW Tokens: 24
 
Join Date: Nov 2007
Posts: 195
Thanks: 0
Thanked 0 Times in 0 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Default Tip: Finding Server File Path

I can't claim to be a PHP guru (so I don't). Nevertheless, I tinker a little bit with PHP from time to time.

Some PHP programs require you to find the server file path for variables etc. My usual technique was to break something and read the warning message. However, a much better way is to create a file (say "serverinfo.php") with the following line in it:-

PHP Code:
<?php echo getcwd(); ?>
Upload to the root directory of you server, then visit the file in a browser. You should get the working directory in a server path format, so you can use it for variables.

It's also located if you run the phpinfo(); variable, but it's lost amongst the data. I personally prefer this method
Reply With Quote