For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > November 2004 > working script









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author working script
Jeff Houston

2004-11-18, 8:55 pm

I just put this cgi up and finally got it to work. I just want to know what
I did or didn't do or both. Here is the example of what was originally on
the script and it would NOT work.

@valid_ref = ('http://mydomain.com/') ;
foreach $ref (@valid_ref) {
if ($ENV{'HTTP_REFERER'} =~ m/$ref/i) {$is_valid = 1 ; last ;}
}

if (! $is_valid) {
print "Content-type: text/html\n\nERROR - Invalid Referrer\n" ;
exit 0 ;
}

All I did was delete this bottom part off and everything worked after that
and I started getting emails. What is this bottom part for and if it don't
work why was it there to start with? Or is there something in that part that
needs to be changed? Any and all help is appreciated.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com