]> 472bisson.ca Git - magnet.git/blob - index.php
2dad933457d659db76db0dd3c569169c87b7e243
[magnet.git] / index.php
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Torrage</title>
5 <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
6 <link href="style.css" rel="stylesheet" type="text/css" />
7 </head>
8 <body>
9 <h1>Torrage</h1>
10 <form action="index.php" method="get">
11 <input type="text" name="infohash"/>
12 <input type="submit" value="Get .torrent"/>
13 </form>
14 <?php //http://torrage.com/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent
15
16 if (filter_has_var(INPUT_GET, 'infohash'))
17 {
18 $infohash = filter_input(INPUT_GET, 'infohash');
19
20 if(strlen($infohash) == 40 && ctype_xdigit($infohash))
21 {
22 //echo "Debug:$url = ".$url."<br />";
23 $url = "http://torrage.com/torrent/".$infohash.".torrent";
24 header( 'Location: '.$url ) ; //Internet
25 }
26 else
27 {
28 echo "<a>Invalid INFO_HASH</a>";
29 }
30 }
31 ?>
32 </body>
33 </html>