How To Add Www On A Domain Name Infront Of The Url

Mobile
feeds
Welcome Login | Register

How To Add Www On A Domain Name Infront Of The Url
  Forums Index
      » PHP Forums
        » » how to add www on a domain name infront of the url



How To Add Www On A Domain Name Infront Of The Url
Post Description:
Post Tags: how, to, add, www, on, a, domain, name, infront, of, the, url, free php support, php scripts, php questions, php answers, programming, codes, scripts
This Post Has Been Viewed 169 Times Since Sat Mar 08, 2008 10:27 am Posted By tutorial with 0 replies
Next Post »» how to copy file or directory in PHP scripts code copying files directories
How To Add Www On A Domain Name Infront Of The Url
let say you have a script and and you want to know the current domain name but if the hostname is not on the url then add it.

for example, i want to force http://wallpaperama.com to be http://www.wallpaperama.com

i can use this

<?
$domainname = $_SERVER['HTTP_HOST'];
if(!strstr($domainname,'www.')){
$domainname = str_replace('www.','',$string);
}
?>





Leave Your Comments






Share
URL:
You can use this HTML code to put it on your website to show your friends this wallpaper. Use this code on your profile like myspace, friendster, Facebook or others. Just Copy and Paste it in your HTML on your websites



Fourms BBCODE:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums





Comments and replies About How To Add Www On A Domain Name Infront Of The Url




(0) Comments