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