Advertisement
6_2008-2009 Internet/ Browsers/ HTML #197217

Check if connected in Internet

Check if connected in Internet... Windows 9X, ME, NT, 2000 and XP compatible...

AI

Shrnutí AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Zdrojový kód
original-source
Upload
<?php
/*Anti-Leech script by Steve Oliver
 This is the best anti-leech out there.
 No way of telling where the file is coming from.
 Set the 2 variables below, $domain and $folder.
 You can replace the errors below where commented with html files if wanted.*/
//your domain
$domain="www.yourdomain.com";
//folder that the files are in, no lead or trailing slashes
$folder="filefolder";
$filename=stripslashes(urldecode($QUERY_STRING));
//this can be replaced with
//if ($filename==""){readfile("http://www.yourdomain.com/invalidfile.html");exit;}
if ($filename==""){die("<h1>Invalid File Request...</h1>");}
$refr=getenv("HTTP_REFERER");
list($remove,$stuff)=split('//',$refr,2);
list($home,$stuff)=split('/',$stuff,2);
//this can be replaced with
//if ($home!=$domain){readfile("http://www.yourdomain.com/leecher.html");exit;
if($home!=$domain){die("<h1>Leecher!</h1>This file is from $domain");
}else{
$fp=@fopen("http://".$domain."/".$folder."/".$filename,"r");
if($fp){
if (ereg(".mp3",$filename)){$xtype="audio/mpeg";}
elseif(ereg(".zip",$filename)){$xtype="application/x-zip-compressed";}
elseif(ereg(".exe",$filename)){$xtype="application/x-msdownload";}
else{$xtype="application/octet-stream";}
Header("Content-Type: $xtype");
Header("Accept-Ranges: bytes");
Header("Content-Disposition: ; Filename=$filename");
readfile("http://".$domain."/".$folder."/".$filename);
}else{
//this can be replaced with
//readfile("http://www.yourdomain.com/filenotfound.html");exit;
die("file not found");
}}
?>
Původní komentáře (3)
Obnoveno z Wayback Machine