Go Back   HajarBos Community > Webmaster Lounge > Hosting Discussion

Donation Goal
Goal amount for this month: 30 USD, Received: 0 USD (0%)
Donate NowDonate HajarBos
Donate to support HajarBos Network, all donation will be use for server cost

How to know absolute public html path

This is a discussion on How to know absolute public html path inside Hosting Discussion forums : So what is the purpose of the absolute path ? The absolute path is a path containing the root directory. ...


Post New ThreadReply
 
Bookmark and Share LinkBack Thread Tools Rate Thread
Old 02-23-2012, 08:16 AM   #1
Site Manager
 
dendik's Avatar
 
Website:
Join Date: May 2010
Location: Surabaya
Posts: 503
Rep Power: 10
dendik has a reputation beyond reputedendik has a reputation beyond reputedendik has a reputation beyond reputedendik has a reputation beyond reputedendik has a reputation beyond reputedendik has a reputation beyond reputedendik has a reputation beyond reputedendik has a reputation beyond reputedendik has a reputation beyond reputedendik has a reputation beyond reputedendik has a reputation beyond repute
Post How to know absolute public html path

So what is the purpose of the absolute path ?
The absolute path is a path containing the root directory. The system can find all the other sub directories relative to the root directory once it knows its location. An example of an absolute path vs relative path on a web server would be:

Absolute Path:

/home/thedomainname/public_html/cgi-bin

Relative Path:

public_html/cgi-bin

Here is what you can use for the php script to find the absolute path:

PHP Code:
<?php
$path 
getcwd();
echo 
"This Is Your Absolute Path: ";
echo 
$path;
?>
Save the above file as findpath.php
It is important that you use '.php' (without the quotes) in the file name as you are making a php script file.

To invoke this script and find the absolute path for your website all you need to do is type in your browser window:

http://www.yourdomainname.com/findpath.php

Be sure to change 'yourdomainname.com' to whatever the correct URL is for your domain. When you type this in your web browser it will display the absolute path similar to this:

This Is Your Absolute Path: /home/yourdomainname/public_html/findpath.php

Good luck
__________________
  • Help us grow ,Donate to HajarBos
  • Please Hit the button if you like my post
dendik is offline   Reply With Quote
Old 02-23-2012, 10:45 AM   #2
Member
 
Website:
Join Date: Feb 2012
Location: world wide web
Posts: 1
Rep Power: 0
Buzz is on a distinguished road
Default

Thanks for the tuts,
Buzz is offline   Reply With Quote
Reply

Tags
absolute, html, path, public


Thread Tools
Rate This Thread
Rate This Thread:



All times are GMT +1. The time now is 04:51 PM.
Hosted by Dikz Network
Copyright © 2010 HajarBos Network

Flasher Community DikzNet Dendik.id Dikz Network Deal N Get
DDLRank Katz DDL Your link DikzNet Forum Whois Checker

Free Full Premium Downloads