Welcome to Webune Web Hosting

We Provide Web Hosting for all types of websites.

if you have a website with us using PHP, you might find this tutorial helpful.

as a php programmer, you will find that there will be times when you will need to know what is your absolute path.

this tutorial will show you how you get can get the absolute path of your script.

all you need is to use the DOCUMENT_ROOT variable,

we have provided the full script in this post, you can download below or if you wish to create the file yourself, you can continue reading....

if you want to see it in action, open your text editor, i am using windows xp to write this post, so i will be using notepad. so open a blank notepad, copy and paste the following code:


absolute-path.php
<h1>Show Absolute Path Script</h1><hr />Your Absolute Path is: <u><?php echo $_SERVER['DOCUMENT_ROOT']; ?></u><br /><br /><p align="center">Courtesy of<br><a href="http://www.webune.com"><img src="http://www.webune.com/images/headers/default_logo.jpg" alt="Webune Hosting" border="0"></a><br />Webune Web Hosting</p>


now save the file as absolute-path.php

once you have saved it, upload to your website which uses PHP and open it with your browser:
example:
http://www.example.com/absolute-path.php
asbsolute-path.zip