donderdag 8 januari 2009

check complete server path to file or folder

Sometimes you need to know the complete server/directory path to a certain folder or file.
Let's say you are using .htaccess you will need to put a link in the file containing the complete server path to this file.

To find out this path, you can use this simple php script.
Create a php file and copy paste this code.
Save the file on your server in the folder of which you want to know the server path.
Open the file in your browser; it will display the complete path to this file.

Good luck!

-----the code----

< ? php
echo dirname (__FILE__);
?>

-----end code----

ps, dont use spaces between "< ? php" , it's just that this blog didnt support printing it otherwise..


or you can always use a hammer...
Please leave your comments.

.

Geen opmerkingen: