X-Git-Url: https://472bisson.ca/gitweb/magnet.git/blobdiff_plain/7b3c9a3af2a65be2653a274977d56e72954b1054..77442f2de0fc311d8f41bf64b19b7f50936072eb:/index.php diff --git a/index.php b/index.php index af11214..3d30be8 100644 --- a/index.php +++ b/index.php @@ -1,39 +1,57 @@ + + Torrage + + + + +

Torrage

+
+ + +
+ + Torrage + + Torcache + + Zoink +
+ - Torrage - - - - - - - - - -

Torrage

-
- - - -
- - "; - - $url = "http://torrage.com/torrent/".$infohash.".torrent"; - - echo $url; - - header( 'Location: '.$url ) ; //Internet - } - ?> - - + if (filter_has_var(INPUT_GET, 'infohash') && filter_has_var(INPUT_GET, 'site')) + { + $infohash = filter_input(INPUT_GET, 'infohash'); + $site = filter_input(INPUT_GET, 'site'); + if (strlen($infohash) == 40 && ctype_xdigit($infohash)) + { + $infohash = strtoupper($infohash); + //echo "Debug:$url = ".$url."
"; + if ($site == 'torrage') + { + $url = "http://torrage.com/torrent/" . $infohash . ".torrent"; + header('Location: ' . $url); //Internet + } + else if ($site == 'torcache') + { + $url = "http://torcache.net/torrent/" . $infohash . ".torrent"; + header('Location: ' . $url); //Internet + } + else + { + $url = "http://zoink.it/torrent/" . $infohash . ".torrent"; + header('Location: ' . $url); //Internet + } + } + else + { + echo "Invalid INFO_HASH"; + } + } + ?> + + \ No newline at end of file