Hi all,
I’m currently using a php page, as index.php, for promoting some domains for sale. i.e. if some one enters in browser, say: [url]http://www.certain_domain.com,[/url] the php page displays the domain name entered among several other wording.
However, if the user types only, [url]http://certain_domain.com[/url] (without www), then, only ’.com’ is displayed in this case.
The code I’m using is:
<?php
$data = explode(".", $GLOBALS["HTTP_HOST"]);
$domain = $data[1] . "." . $data[2];
?> <h1 align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="3">Bla, bla, bla, bla</font><br>
<h1 align="center"><b><font face="Verdana, Arial, Helvetica, sans-serif" color="#33CC99">
<?php echo $domain; ?> </font></b></h1>
What do I need to add/modify in the coding to make this also workable when user omits the ‘www’ when entering the url in the browser?
I will highly appreciate your help.
ACUMARA