CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
require file and referer url

 



badboy
Deleted

May 9, 2000, 8:51 PM

Post #1 of 2 (498 views)
require file and referer url Can't Post

How do I change a script that checks refering URLs from within to a seperate file with the require function.

Current script:
@referers = 'http://www.mydomain.com','http://www.another.com');
# Check Referring URL
&check_url;
sub check_url {
local($check_referer) = 0;

if ($ENV{'HTTP_REFERER'}) {
foreach $referer (@referers) {

if ($ENV{'HTTP_REFERER'} =~ /$referer/i) {
$check_referer = 1;
last;
}
}
}
else {
$check_referer = 1;
}
if ($check_referer != 1) { &error('bad_referer') }
}


Cure
User

May 13, 2000, 1:26 PM

Post #2 of 2 (498 views)
Re: require file and referer url [In reply to] Can't Post

Hi

To require a file. Example

require "cure.pl";

this will bring cure.pl into your main script


Cure

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives