NamePros.Com (http://www.namepros.com/)
-   Web Design Discussion (http://www.namepros.com/web-design-discussion/)
-   -   Help needed :) (http://www.namepros.com/web-design-discussion/465985-help-needed.html)

KillerDomain 05-06-2008 03:06 AM

Help needed :)
 
Could anyone tell me how to create a bit of code…?

What I am looking is:

If someone types in or visits one of my domains - I want it to display the name of the domain that they entered.

I have all my domains landing on one page, but I want it to say 'domain name' is for sale…

Thanks.

enlytend 05-06-2008 04:13 AM

In PHP, look at $_Server['HTTP_Referrer']. i.e.

PHP Code:
<?php echo $_Server['HTTP_Referrer']; ?> is for sale


Don't rely on this being a simple URL. Some software blocks referrers, search querys will probably include the search URL and string, so do some checking to see if it is what you're expecting, and either fix it or have some default code if it is not.

Referrers can also be spoofed, so you should also clean up the string to remove anything malicious before using it.

netzilla 05-08-2008 12:57 PM

JavaScript has a document.referrer property you can check out if you don't have access to a php-enabled web server.

tres 05-08-2008 01:28 PM

To show the name of the domain name as listed in apache use:
PHP Code:
$_SERVER['HTTP_HOST']


To show the name of the URL the visitor has come from use:
PHP Code:
$_SERVER['HTTP_REFERRER']
Note: http_referrer may be blank for a number of reasons.

Javascript to display the domain name,
Code:
<script type="text/javascript"> document.write(document.domain); </script>

nsk 05-21-2008 07:24 PM

Nsk
 
OK..
www.9nsk.cn.
ntn SKF FAG NSK timken


All times are GMT -7. The time now is 02:27 PM.
Site Sponsors
Advertise your business at NamePros

Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0