Show Display Relative Root Path PHP Function Absolute Path Linux Hosting



Show Display Relative Root Path PHP Function Absolute Path Linux Hosting
 (387) PHP Mysql Hosting
Show Display Relative Root Path PHP Function Absolute Path Linux Hosting
Post Description:
Post Tags: show, display, relative, root, path, php, function, absolute, path, linux, hosting
This Post Has Been Viewed 6727 Times Since Tue Sep 05, 2006 8:48 am Posted By hostman with 1 replies
Show Display Relative Root Path PHP Function Absolute Path Linux Hosting
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     [ dejar commentarios ]
  * Name     [nombre]

  * eMail (will not be published)     [coreo electronico]

* Enter Your Reply or Comments:    [commentarios]


Add Picture To Comments         [incluir foto]
YES NO             upload
Receive Replies on my Comments (An email will be sent to you when someone replies to your comments)

     

Comments and replies About Show Display Relative Root Path PHP Function Absolute Path Linux Hosting




:: 1 :: #45700 - Reply By Innocent Kazooba On Sun Mar 16, 2008 7:29 am
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.