Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Getting the URL of a referer

by Thelonius (Priest)
on Dec 23, 2003 at 18:18 UTC ( [id://316672]=note: print w/replies, xml ) Need Help??


in reply to Getting the URL of a referer

First, this "http://www.yahoo.com/s=2342&stuff=asdfsd" is a URL; this "www.yahoo.com" is a domain name or host name. Second, be aware that the referer is not always present.

There are many ways to do this (say, maybe that should be a slogan :-).

The best way, if you have the URI module installed, is this:

use URI::URL; my $host = URI::URL->new($ENV{'HTTP_REFERER'})->host;
That will handle more obscure cases, such as "https://joe@www.yahoo.com:4040/fred?billy".

Replies are listed 'Best First'.
Re^2: Getting the URL of a referer
by Coruscate (Sexton) on Dec 23, 2003 at 19:24 UTC
    There are many ways to do this (say, maybe that should be a slogan :-).

    Sorry man, you're a little too late for that. We've already got the slogan for that. Yours is so close I can't help but wonder if you already know it and the smiley emoticon is hinting at the slogan. Here t'is:

    TIMTOWTDI: There Is More Than One Way To Do It

      Thanks alot guys/gals I will try all of your suggestions!!!

      A*C

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://316672]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-05-21 07:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found