2 if(filter_has_var(INPUT_GET
, 'submit'))
4 $infohash = filter_input(INPUT_GET
, 'infohash');
5 $name = filter_input(INPUT_GET
, 'tname');
6 $trackers = filter_input(INPUT_GET
, 'trackers');
8 if(strlen($infohash) == 40 && ctype_xdigit($infohash))
10 $magnetlink = "magnet:?xt=urn:btih:" . $infohash;
14 $magnetlink = $magnetlink . "&dn=" . $name;
18 $magnetlink = $magnetlink . "&tr=" . $trackers;
21 //$magnetlink = "magnet:?xt=urn:btih:" .$infohash . "&dn=" . $name . "&tr=" . $trackers;
28 <meta charset
="utf-8" />
29 <meta name
="viewport" content
="width=device-width, initial-scale=1">
30 <link rel
="stylesheet" type
="text/css" href
="https://www.w3schools.com/w3css/4/w3.css">
33 <div
class="w3-card-4">
34 <div
class="w3-container w3-green">
37 <form
class="w3-container" name
="form1" method
="get" action
="#">
39 <label
>Infohash
</label
>
40 <input
class="w3-input" type
="text" name
="infohash" placeholder
="Hash of the Torrent" />
44 <input
class="w3-input" type
="text" name
="tname" placeholder
="Name of the Torrent" />
47 <label
>Trackers
</label
>
48 <input
class="w3-input" type
="text" name
="trackers" placeholder
="Trackers" />
51 <input
class="w3-button w3-green" type
="submit" name
="submit" value
="Create"/>
52 <input
class="w3-button w3-green" type
="reset" name
="reset" value
="Reset">
56 <?php
if(isset($magnetlink))
59 <div
class="w3-panel w3-pale-green w3-leftbar w3-border-green">
60 <p
><a href
= "<?php echo $magnetlink; ?>"><?php
echo $magnetlink; ?
></a
></p
>
66 <div
class="w3-panel w3-pale-green w3-leftbar w3-border-green">
67 <p
>Enter Some Torrent Info Hash
</p
>