WebRef.eu  - Internet Marketing and Online Business Resources

Home | Contact Us

Google
 

Obtain Site Domain Name in PHP

Sometimes you want to automatically obtain the site domain name in PHP. This technique means you don't have to hard code references to the site domain name in your script, making it easier for your script to be used on other sites.

E.g. if the url of your script was:

http://www.mysite.co.uk/show-review.php

and you wanted to put the site domain into a variable, i.e. put www.mysite.co.uk into a variable, the code to use would be:

<?php
$domain = $_SERVER['HTTP_HOST'];
?>

 



Join Top Affiliate Networks Join Top Affiliate Networks >>>



Paid On Results

Expansys








Home | Contact Us

All Content ©2006 WebRef.eu