Gossamer Forum
Quote Reply
referer check
i have searching the forum, but i have not found anything.

i search a solution, to show a message, when the user comes not via the root url.

has anyone anything like that?
Quote Reply
Re: [topseo] referer check In reply to
Something like this MAY work;

Code:
sub {

my $ref = $ENV{'HTTP_REFERER'};
my $domain = $CFG->{build_root_url};

if ($ref =~ /\Q$domain/i) {
return "Was refered from this site...";
} else {
return "Was NOT refered from this site...";
}

}

Call with: <%global_name%>

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] referer check In reply to
Smile @ andy

many thanks! it works great!

greetings from germany

topseo
Quote Reply
Re: [Andy] referer check In reply to
@ andy

is it possible, to return "true - false", "yes - no" or " 1 - 0"?
so a i can use it like that:

<%if referer_check = yes%>.....<%else%>.....<%endif%>

thanks

topseo
Quote Reply
Re: [topseo] referer check In reply to
hi andy,

i have found the solution.

thanks.


topseo
Quote Reply
Re: [topseo] referer check In reply to
Unfortunately referer check is not a "safe" solution.
Referer data can be overrided by any user, with any data, if the user uses a browser which allows to change/delete/override referer.

Referer check works for most users but there will be always some, who can not catched by that way.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Post deleted by topseo In reply to