I dont want people to be able to access any of the cgi files without being referred from my site, so at the top of each file I have replaced main(); with...
my ($found);
my @ref = ('.audio-grabber.com');
if (@ref) {
$found = 0;
if ($ENV{'HTTP_REFERER'}) {
foreach (@ref) { $ENV{'HTTP_REFERER'} =~ /\Q$_\E/i and $found++ and last; }
}
if (! $found) {
print "Content-type: text/html \n\n";
print "You cannot access this script because you have not been referred from Audio-Grabber.";
exit;
}
} else {
main();
}
When I try to access the cgi scripts through my browser if gives the correct error saying that they arent allowed to access the file, but when they click a link to the script from my website it gives an internal server error...why is this?
Thanks!
Paul Wilson.
(Dont blame me if I'm wrong!)
my ($found);
my @ref = ('.audio-grabber.com');
if (@ref) {
$found = 0;
if ($ENV{'HTTP_REFERER'}) {
foreach (@ref) { $ENV{'HTTP_REFERER'} =~ /\Q$_\E/i and $found++ and last; }
}
if (! $found) {
print "Content-type: text/html \n\n";
print "You cannot access this script because you have not been referred from Audio-Grabber.";
exit;
}
} else {
main();
}
When I try to access the cgi scripts through my browser if gives the correct error saying that they arent allowed to access the file, but when they click a link to the script from my website it gives an internal server error...why is this?
Thanks!
Paul Wilson.
(Dont blame me if I'm wrong!)