- <h1>Torrage</h1>\r
- <form action="index.php" method="get">\r
- <input type="text" name="infohash"/>\r
- <input type="submit" value="Get .torrent"/>\r
- </form> \r
- <?php //http://torrage.com/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent\r
- \r
- if (filter_has_var(INPUT_GET, 'infohash'))\r
- {\r
- $infohash = filter_input(INPUT_GET, 'infohash');\r
- \r
- if(strlen($infohash) == 40 && ctype_xdigit($infohash))\r
- {\r
- //echo "Debug:$url = ".$url."<br />";\r
- $url = "http://torrage.com/torrent/".$infohash.".torrent";\r
- header( 'Location: '.$url ) ; //Internet \r
- }\r
- else\r
- {\r
- echo "<a>Invalid INFO_HASH</a>"; \r
- }\r
- }\r
+ <section class="w3-panel"> \r
+ <div class="w3-card-4">\r
+ <div class="w3-container w3-theme">\r
+ <h2>Magnet Info</h2>\r
+ </div>\r
+ <form class="w3-container" name="magnet" method="get" action="#">\r
+ <p>\r
+ <label>Infohash</label>\r
+ <input class="w3-input" type="text" name="infohash" value='<?php echo $infohash ?>' placeholder="Hash of the Torrent Ex: DA39A3EE5E6B4B0D3255BFEF95601890AFD80709" />\r
+ </p>\r
+ <p>\r
+ <label>Name</label>\r
+ <input class="w3-input" type="text" name="tname" value='<?php echo $tor_name ?>' placeholder="Name of the Torrent Ex:Linux 5.7" />\r
+ </p>\r
+ <p>\r
+ <label>Trackers</label>\r
+ <textarea class="w3-input" name="trackers" placeholder="One tracker per line Ex: udp://tracker.opentrackr.org:1337/announce"><?php echo $trackers ?></textarea>\r
+ </p>\r
+ <p>\r
+ <label>Webseeds</label>\r
+ <input class="w3-input" type="text" name="webseeds" value='<?php echo $webseeds ?>' placeholder="Web Seeds Ex: http://example.com/linux.iso" />\r
+ </p>\r
+ <p>\r
+ <input class="w3-button w3-theme-l3" type="submit" name="submit" value="Create"/>\r
+ <input class="w3-button w3-theme-l3" type="reset" name="reset" value="Reset">\r
+ </p>\r
+ </form>\r
+ </div> \r
+ <?php\r
+ if(isset($error_code))\r
+ {\r
+ if($error_code == 1)\r
+ {\r
+ ?>\r
+ <div class="w3-panel w3-pale-red w3-leftbar w3-border-red">\r
+ <p>Error : Infohash cannot be empty.</p>\r
+ </div>\r
+ <?php\r
+ }\r
+ else if($error_code == 2)\r
+ {\r
+ ?>\r
+ <div class="w3-panel w3-pale-red w3-leftbar w3-border-red">\r
+ <p>Error : Invalid Infohash.</p>\r
+ </div>\r
+ <?php\r
+ }\r
+ }\r
+ else if(isset($magnetlink))\r
+ {\r