Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/04/2002, 04:15
Avatar de ||Dj||
||Dj||
 
Fecha de Ingreso: enero-2002
Mensajes: 2.349
Antigüedad: 22 años, 3 meses
Puntos: 1
Re: Error en código

Cita:
#!/usr/bin/perl
# You must modify the the location of PERL in the first line above to match #
# the location on your server. Your system admin must help you with this. #
# You must also modify the following variables to match your preferences. #

# This is the counter log filename
$Counter = '/usr/home/yoursite/download.log';

# This is the location of your files
$Path = 'http://yoursite.com/downloads/';

# uncomment the line below, if you want to make it
# so that only some domains can download files
# change domain1 domain2 etc to the domains allowed
# to download files

#@okaydomains=("http://www.domain1.com", "http://209.66.79.225", "http://www.winfiles.com", "http://downloadfast.com", "http://www.downloadfast.com");

# This is the file to go to when a site has stole one of your links
# This has no effect if the line above is commented
$403 = 'http://yoursite.com/notallowed.shtml';


################################################## ########
# No changes need to be made after these lines
################################################## ########
$File = $ENV{'QUERY_STRING'};
$DownloadFile = "$Path$File";

# This will check if the link was stolen

if (@okaydomains == 0)
{return;}
$DOMAIN_OK=0;
$RF=$ENV{'HTTP_REFERER'};
$RF=~tr/A-Z/a-z/;
foreach $ts (@okaydomains)
{
if ($RF =~ /$ts/)
{ $DOMAIN_OK=1; }
}
if ( $DOMAIN_OK == 0) {

print "Content-type: text/html\n";
print "Location: $403\n\n";

exit;
}

# Add hit to main counter

open (CNT,"+<$Counter") || &endIt;
flock (CNT,2); seek (CNT,0,0);
@infile = <CNT>;

# This will put the hits in order from max to min for each file added
$record = 0; # Starting record in the log is always 0
$correctspot = 'N'; # Tells script if this record is the one that was hit
---sigue abajo