]> 472bisson.ca Git - magnet.git/commitdiff
Validated InfoHash and Style.
authorManjunath CV <cvmanjoo@gmail.com>
Wed, 25 Dec 2013 11:58:47 +0000 (17:28 +0530)
committerManjunath CV <cvmanjoo@gmail.com>
Wed, 25 Dec 2013 11:58:47 +0000 (17:28 +0530)
index.php
infohash.txt [new file with mode: 0644]
style.css

index af112141bb35cfce07de49f9079f0c5408e90291..c32640f097a42a3fb9e4a28cf4821eb5bc5f2e0e 100644 (file)
--- a/index.php
+++ b/index.php
@@ -7,33 +7,36 @@
                <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
                
                <link href="style.css" rel="stylesheet" type="text/css" />
-               <link href='http://fonts.googleapis.com/css?family=Voces' rel='stylesheet' type='text/css'>
 
        </head>
        
        <body>
                <h1>Torrage</h1>
                <form action="index.php" method="get">
-                       <input type="text" width="600" name="infohash"/>
+                       <input type="text" name="infohash"/>
                        <input type="submit" value="Get .torrent"/>
-                               
                </form>
                
                <?php 
                
                //http://torrage.com/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent
-               
                if(isset($_GET["infohash"]))
                {
                        $infohash = $_GET['infohash'];
-                       echo "Debug:IF --".$_GET["infohash"]."<br /> ";
-                       
-                       $url = "http://torrage.com/torrent/".$infohash.".torrent";
-                       
-                       echo $url;
-                                               
-                       header( 'Location: '.$url ) ;  //Internet 
+                       //echo "Debug:IF -- ".$_GET["infohash"]."<br /> ";
+                       if(strlen($infohash) == 40 && ctype_xdigit($infohash))
+                       {
+                               //echo "Debug:$url = ".$url."<br />";
+                               $url = "http://torrage.com/torrent/".$infohash.".torrent";
+                               header( 'Location: '.$url ) ;  //Internet 
+                       }
+                       else
+                       {
+                               echo "<a>Invalid INFO_HASH</a>";        
+                       }
                }
                ?>
+               <label></label>
+       </body>
 
-</html>
+</html>                                                                                                           
\ No newline at end of file
diff --git a/infohash.txt b/infohash.txt
new file mode 100644 (file)
index 0000000..0036829
--- /dev/null
@@ -0,0 +1,8 @@
+http://torrage.com/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent
+
+
+ubuntu-13.10-desktop-i386.iso --> 597A92F6EEED29E6028B70B416C847E51BA76C38
+
+non exist -->                                    886D8CA336A8BBE7C1B19C8B5D23729496F7A48F
+
+xbmc-12.3.exe -->                                F948DD1E2A216B018FC3B5BA3FB4B1A63F61F06B
\ No newline at end of file
index 3ccef14ffdadf346666c807caf0ba94f65a21fc8..e5611c1d00de89e57d17907ec9018768110eea8f 100644 (file)
--- a/style.css
+++ b/style.css
@@ -1,9 +1,42 @@
-/* CSS layout */
+/* CSS layout */
 
 body{
        margin: 5px;
        padding: 5px;
-       font-family: 'Voces', cursive;
+       font-family: monospace;
 }
 
-/*http://www.tdl.com/~jrb/jrb7/css_textfield0.html */
\ No newline at end of file
+input[type=text] {
+       width: 420px;
+       height: 30px;
+       padding: 1px;
+       
+       font-family:monospace;
+       font-size:large;
+}
+
+input[type=submit] {
+               
+       font-family:monospace;
+       font-size:large;
+
+       border: 1px solid #777777;
+       background: #6e9e2d;
+       color: white;
+       font: bold 11px 'Trebuchet MS';
+       padding: 4px;
+       height: 30px;
+       cursor: pointer;
+       -moz-border-radius: 4px;
+       -webkit-border-radius: 4px;
+*/}
+
+
+
+
+/*
+
+http://www.tdl.com/~jrb/jrb7/css_textfield0.html
+http://www.red-team-design.com/style-an-input-button
+
+*/
\ No newline at end of file