Show Display Relative Root Path PHP Function Absolute Path Linux Hosting

Mobile
feeds
Welcome Login | Register

Show Display Relative Root Path PHP Function Absolute Path Linux Hosting
Reply Your Comments:
Click this button if you are interested in replying to this topic and leave your comments
Sent To Friend
CLick this button if you want to send this page to a friend.
Subsribe To Rss Feeds
Subscribe to RSS
CLick this button if you want to subscribe to this RSS Feed. You can use your browsers feeds burners if you have mozilla or internet explorer 7 or higher and keep up with updates.
  Forums Index
      » PHP Forums
        » » Show Display Relative Root Path PHP Function Absolute Path Linux Hosting
Show Display Relative Root Path PHP Function Absolute Path Linux Hosting
Post Description: show display relative root path php function absolute path linux hosting PHP
Post Tags:
This Post Has Been Viewed 10350 Times Since Tue Sep 05, 2006 8:48 am Author hostman with 4 replies
Show Display Relative Root Path PHP Function Absolute Path Linux Hosting
Advertise On This Page




PHP is great. I just found a function which display the Arbsolute of a file. This function is helpful when you are writing scripts or code in you PHP so that you know what exactly your root absolute relative path is:

getcwd()

-- Gets the current working directory

The only requirement for this to work on your web pages is that you have PHP in your hosting. IF you don't have php, you can signup with www.webune.com for a php plan. if you have php, continue on...

copy and paste this code into your text editor, you can use windows notepad if you like:

<HTML>
<TITLE>Absolute Path Sample Script Showing How To Get Absolute Path In PHP</TITLE>
<HEAD>
<style type="text/css">
<!--
.style2 {color: #0066FF}
-->
</style>
</HEAD>
<BODY>
<strong>Absolute Path Sample Script Showing How To Get Absolute Path In PHP</strong>
<h1 align="center">The Absolute Path is: <span class="style2"><?php echo getcwd(); ?></span></h1>
<div align="center">Turotial by <a href="http://www.wallpaperama.com">Wallpaperama.com</a></div>
<hr size="2" noshade>
<p>This Script was developed by <a href="http://www.wallpaperama.com">Wallpaperama.com</a> - Support us by telling your friends about wallpaperama and help contribut to the open source by adding your knowledge of PHP, Linux, Mysql and more to others, just like this script.</p>
<p>Thank You</p>
<p>Wallpaperama Team</p>
<p><a href="http://www.wallpaperama.com/forums/show-display-relative-root-path-php-function-absolute-path-linux-hosting-t378.html">&lt;&lt; Go Back</a> </p>
<p align="center">PHP Hosting by <a href="http://www.webune.com">Webune.com</a> </p>
<p>
</BODY>
</HTML>


now save the file as : absolutepath.php and upload to your server with php hosting and it will display the directory of the absolute path of where the script is.

Remember, you will need php for this to work, if you dont have php yet, you can sign up at: www.webune.com

This is an example of the output:
The Absolute Path is: /var/www/html/public_files


I hope this helps.


Leave Your Comments

Your Name
Your Email Address (Will Not Be Published)
Notify Me When Someone Replies to this Page
(An email will be sent to you when someone replies to your comments)
Your Comments
Include A Picture with your comments
Share
| More
Share this page by putting this URL in your comments to other websites like myspace, Facebook, Twitter friendster, Hi5, Groups, Boards, Forum or others. Just Copy and Paste this Code
URL:
To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it.
Embed:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
BBCODE:
Subscribe Feeds
Webmasters - Exchange Links With Us. Add related websites to this topic
Add Link:
Links Related to : Show Display Relative Root Path PHP Function Absolute Path Linux Hosting

Comments and replies About Show Display Relative Root Path PHP Function Absolute Path Linux Hosting
:: 1 :: Reply #45700 Reply By Innocent On Sun Mar 16, 2008 7:29 am
Innocent:
thanks man - it saved me. i develop my projects on a local machine and have to uplaod the finished projects on different servers - i have always had issues with absolute path. but after now, i will not have those issues any more. thank you and keep smiling. be blessed always.
:: 2 :: Reply #97822 Reply By Rahul On Sat Mar 21, 2009 8:21 am
Rahul:
thankyou. i was looking for this function because mkdir() needs the absolute path.
:: 3 :: Reply #106382 Reply By nero On Tue Jun 16, 2009 12:04 am
nero:
thx u very much, i am very confident that many people make use of this script.


:-)
:: 4 :: Reply #126765 Reply By daniel On Tue Jan 26, 2010 1:03 pm
daniel:
what if i don't want The Absolute Path to show up but instead say mysite dot com ?