Forum Moderators: open
this domain has been registered by www.mysite.com for more info....
I would like a script (JS or otherwise) that displayed:
www.newdomain.com has been registered by www.mysite.com for more info....
Anyone got a method for a call like this? Cheers, Limbo.
The server knows what it is called. So server-side technologies can return return the information for you.
If you hosting your site on an Apache server, with Server Side Includes (SSI) enabled then if your display page includes the line:
This site is called <!--#echo var="SERVER_NAME" -->
You would get the result you are looking for, because the server would replace the comment text by wwww.yourdomain.com or whatever.
The perl solution is a little more involved.
For a good reference on the basics of SSI, have a look at Apache's own tutorial at [httpd.apache.org ]
$_SERVER['SERVER_NAME']
$HTTP_SERVER_VARS['SERVER_NAME']
My personal choice is to use SSI for simple tasks, and PHP for anything more intelligent, but that's also related to how the servers are configured.
Mike you JS version worked a treat, thank you.
<p>
<em><?php print "$_SERVER['SERVER_NAME']"?></em> has been registered by www.mysite.com for more info...
</p>