homepage Welcome to WebmasterWorld Guest from 54.198.148.191
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Adding referrer check to existing script
newjay1000




msg:4011712
 6:51 pm on Oct 22, 2009 (gmt 0)

This is my first post here folks so be gentle with me. I am not a PERL guy at all, but I am using a suite a perl scripts (ez scripts if anyone has heard of them) for a simple project I am doing. I have recently hit a streak of spam coming from outside my domain (obviously) Until I can convert my whole system over to php I wanted to at least add a referrer check the the head of the script if possible. This will at least slow down my spamming issue. Is it even possible to add a simple referrer check to the script and if so what would the code look like? Thanks to any help out there!

Jason

 

phranque




msg:4011802
 8:43 pm on Oct 22, 2009 (gmt 0)

welcome to WebmasterWorld [webmasterworld.com], newjay1000!

have you tried checking the ENV hash?

if there is a referrer and it has been set by the user agent and is passed through to the web server then $ENV{HTTP_REFERER} will have that value in your script.

be aware that there are often cases where the request is referred but the referrer is not specified in the request.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved