Hey Waz - Perl question

Zach

New member
You know Perl ?

Got a script I'd be interested in having you look over for a minute.

Its very small
 

Zach

New member
Ok, well basically this is a script to help curve folks from linking to files etc..
It works pretty much, but I recently noticed in Mozilla it gives away the location where the files are stored. I was wondering if you might be able to "fix" that, or whatever.

Code:
#!/usr/bin/perl
###############################################
##                      ##
## Downloader v.1              ##
## ----------------------------------------- ##
## by Graeme (webmaster@cgi-scripting.com)  ##
## http://www.CGI-Scripting.com       ##
##                      ############################
## This version of Downloader is free, if anyone sold it to you    ##
## please contact me. Please DO NOT remove any of the copyrights or  ##
## links to our site, they keep this CGI free for everyone.      ##
##                                   ## 
## (c) Copyright 2000 CGI Scripting                  ##
#########################################################################

# Look in the readme.txt file for help setting up this script

$defaulturl = "http://www.gamerzdomain.net";

@okaysites = ("http://gamerzdomain.net", "http://www.gamerzdomain.net");  

$url_1 = "http://www.gamerzdomain.net/insertdownloadlocation";
$url_2 = "http://www.gamerzdomain.net/insertdownloadlocation";
$url_3 = "http://www.gamerzdomain.net/insertdownloadlocation";
$url_4 = "http://www.gamerzdomain.net/insertdownloadlocationt";


####################### DO NOT EDIT BELOW THIS LINE ######################

@querypairs = split(/&/, $ENV{'QUERY_STRING'});
foreach $querypair (@querypairs) {
	($queryname, $queryvalue) = split(/=/, $querypair);
	$queryvalue =~ tr/+/ /;
	$queryvalue =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  $queryvalue =~ s/<([^>]|\n)*>//g;
	if ($QUERY{$queryname}) { $QUERY{$queryname} = $QUERY{$queryname}.",".$queryvalue; }
	else { $QUERY{$queryname} = $queryvalue; }
}

$reffer = $ENV{'HTTP_REFERER'};
$yes = 0;
foreach $domain (@okaysites) {
if ($reffer =~ /$domain/) {
$yes = 1;
}
}

$theu = "url"."_"."$QUERY{'site'}";

if ($$theu && $yes == 1) {
print "Location: $$theu/$QUERY{'filename'}\n\n";
} else {
print "Location: $defaulturl\n\n";
}
exit;
 
J

Jet Set Willy

Guest
I think you need another script/approach, really. You'll never be able to hide the real location of a file from a browser - it needs to know at some point, or it can't get there. Mozilla has a habit of showing the user the truth, unfortunately.
 

Zach

New member
Yea I was hoping you wouldn't have something like that to say.

I actually have another script that does work on my own server and is PHP, however for some reason it won't work on Jay's and nothing else I have found is satisfactory.

Even the support people at his dopey web host don't know why it won't run. But hes changing over to my host in a few months so I guess we'll ride it out till then.

Thanks for looking tho.
 
Top