- Forums
- PHP
- Learn How To Display Current Domain PHP Name Hostname Site Url Address
This Page Contains information about Learn How To Display Current Domain PHP Name Hostname Site Url Address By wallpaperama in category PHP with 1 Replies. [998], Last Updated: Sat May 18, 2024
wallpaperama
Sat Jan 06, 2007
1 Comments
2092 Visits
Today i was writing a script and i wanted to know how i can learn to diplay or get the domain name and printed on the screen.
With php, this is simple. php has a function called getenv().
it displays the current domain name:
for example, if i were to run this code:
CODE:
<?php
echo getenv('HTTP_HOST');
?>
the output will look like this if the url was:
http://www.wallpaperama.com/thisfile.phpCODE:
www.wallpaperama.com
NOTE: in order for this to work on your site, you will need to have PHP. If you don't have PHP hosting on your site, you can start by singing up with our friends at www.webune.com - We recommend them to all our customer.
http://www.wallpaperama.com/forums/php-how-to-show-domain-name-of-your-current-website-display
https://www.wallpaperama.com/forums/learn-how-to-display-current-domain-php-name-hostname-site-url-address-t689.html