homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

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

5+ Year Member

Msg#: 4011710 posted 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!




WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Msg#: 4011710 posted 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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved