Show Display Relative Root Path PHP Function Absolute Path Linux Hosting
show display relative root path php function absolute path linux hosting
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
POST# 332
Posted On: Fri Feb 29, 2008 12:01 pm
web hosting
Topic: 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.


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

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload