How To Get Absolute Path

RegisterLogin
How To Get Absolute Path
Post Description: Shows You How To Get Absolute Path For Situations Where You Want To Know Or Show What The Absolute Path Of Your Script Or Web Hosting Space Is Located At
Tags: How, To, Get, Absolute, Path
This Post Was Posted On Dec 17, 2009 By Webune Tutorials #2911
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
Download File: asbsolute-path.zip
jessie
#3251 1
how do you get the full path in for a form and put it in the action section of the webform?
Jan 14, 2010 Reply Report abuse
©2012 Webune Forums - Sun Dec 16, 2012 1:50 am
Powered by: Webune Forums V3