Forum Moderators: DixonJones

Message Too Old, No Replies

Obtain referring domain

for use in a parked domain page

         

wintercornuk

8:50 pm on Mar 1, 2006 (gmt 0)

10+ Year Member



I've got a couple of dozen unused domains. They get a few type ins per day and I was going to sell them, but I thought before I do that I'll try some parking with ads.

I've created a snazzy park page with some ads on them but want to know can I determine the domain someone types in and show that on the page? I could do it manually, but this intrigues me. Also, could I scan that name for a keyword (they all have them) and use that in the ad code?

I've looked around but can't see anything helpful.

Thanks.

Dijkgraaf

9:20 pm on Mar 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What sort of scripting language have you got available?
Because it is easy enough to look at the HTTP Headers in a scripting language to get that sort of information.

wintercornuk

10:48 pm on Mar 1, 2006 (gmt 0)

10+ Year Member



The server is linux. The pages are html, but could be php easily enough.

jatar_k

10:50 pm on Mar 1, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



php will work easily enough

echo $_SERVER['HTTP_HOST'];

I think that's right

ref: $_SERVER [php.net]

wintercornuk

8:56 am on Mar 2, 2006 (gmt 0)

10+ Year Member



Thanks for the info. That one just returns the uri of my server.

I tried a few other ones from that page and this is the closest:

<!--#echo var="HTTP_REFERER" -->

but it returns:

http://www.example.co.uk

when i just want example.co.uk. Is there a way of parsing it so it strips out the unwanted bits?

jatar_k

9:18 am on Mar 2, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



hmm, I am a little confused

>> want to know can I determine the domain someone types in

I am thinking that means the domain they are at

referer is where they came from, if you echo referer and they came from google then it will say google

take a look at parse_url [php.net] for chopping up urls

wintercornuk

10:30 am on Mar 2, 2006 (gmt 0)

10+ Year Member



Sorry to confuse you. In my domain panel I've simply diverted the domain to a single page. That page contains the ads etc.

When someone types in www.example.co.uk they actually go to www.mydomain.com/park/example.shtml and the typed domain stays in the addressbar. Not an elegant solution, but it's just for testing for now.