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