Show Display Relative Root Path PHP Function Absolute Path Linux Hosting

RegisterLogin
Show Display Relative Root Path PHP Function Absolute Path Linux Hosting
Post Description: Show Display Relative Root Path PHP Function Absolute Path Linux Hosting
Tags: Show, Display, Relative, Root, Path, PHP, Function, Absolute, Path, Linux, Hosting
This Post Was Posted On Feb 29, 2008 By web hosting #1173
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
Related Pages: [Add Your Website]
Post New Topic
Innocent Kazooba
#1580 1
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.
Mar 16, 2008 Reply Report abuse
©2011 Webune Forums - Sun Dec 18, 2011 6:51 pm
Powered by: Webune Forums V3