Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include '../../../../includes/config.php';
- $titulo = $_POST['titulo'];
- $descricao = $_POST['descricao'];
- $categoria = $_POST['categoria'];
- $tamanho = $_POST['tamanho'];
- $magnet = $_POST['magnet'];
- $tags = $_POST['tags'];
- $erro = 0;
- $tamanho_bytes = $tamanho*1048576;
- /*Valida os Campos*/
- if (empty($descricao))
- {echo"<script type='text/javascript'>";
- echo "alert('Atenção, a Descrição não é Válida');";
- echo "javascript:history.go(-1)";
- echo "</script>"; $erro=1;}
- if (preg_match('#magnet:\?xt=urn:btih:(?<hash>.*?)&dn=(?<filename>.*?)&tr=(?<trackers>.*?)$#', $magnet, $magnet_link)){
- $hash = $magnet_link['hash'];
- $nomedoarquivo = $magnet_link['filename'];
- /*[trackers] => Array
- (
- [0] => udp://tracker.com:80
- [1] => udp://tracker.publicbt.com:80
- [2] => udp://tracker.istole.it:6969
- [3] => udp://tracker.ccc.de:80
- [4] => udp://open.demonii.com:1337
- )
- */
- $magnet_link['trackers'] = explode('&', urldecode(str_replace('tr=','', $magnet_link['trackers'])));
- //so to get first tracker
- $magnet_link['trackers'][0];
- mysql_query("INSERT INTO torrents (name, description, category_id, size, hash, tags, created_at, updated_at) VALUES ('$nomedoarquivo', '$descricao', '$categoria', '$tamanho_bytes', '$hash', '$tags', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)");
- }else{
- echo"<script type='text/javascript'>";
- echo "alert('Atenção, o Magnet Link não é Válido');";
- echo "javascript:history.go(-1)";
- echo "</script>";
- };
- ?>
- <style>
- .form-container {
- border: 1px solid #808080;
- font-family: 'Helvetica Neue',Helvetica,sans-serif;
- text-decoration: none;
- vertical-align: middle;
- min-width:60%;
- padding:20px;
- width:60%;
- margin:0 auto;
- }
- .form-field {
- border: 1px solid #787777;
- background: #faf4ed;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- color: #242423;
- -webkit-box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(000,000,000,0.7) 0 0px 0px;
- -moz-box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(000,000,000,0.7) 0 0px 0px;
- box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(000,000,000,0.7) 0 0px 0px;
- padding:8px;
- margin-bottom:20px;
- width:100%;
- }
- .form-field:focus {
- background: #fff;
- color: #666564;
- }
- .form-container h2 {
- text-shadow: #ffffff 0 1px 0;
- font-size:18px;
- margin: 0 0 10px 0;
- font-weight:bold;
- text-align:center;
- }
- .form-title {
- margin-bottom:10px;
- color: #636266;
- text-shadow: #ffffff 0 1px 0;
- }
- .submit-container {
- margin:8px 0;
- text-align:right;
- }
- .submit-button {
- border: 1px solid #447314;
- background: #6aa436;
- background: -webkit-gradient(linear, left top, left bottom, from(#8dc059), to(#6aa436));
- background: -webkit-linear-gradient(top, #8dc059, #6aa436);
- background: -moz-linear-gradient(top, #8dc059, #6aa436);
- background: -ms-linear-gradient(top, #8dc059, #6aa436);
- background: -o-linear-gradient(top, #8dc059, #6aa436);
- background-image: -ms-linear-gradient(top, #8dc059 0%, #6aa436 100%);
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- -webkit-box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(255,255,255,0.4) 0 1px 0;
- -moz-box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(255,255,255,0.4) 0 1px 0;
- box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(255,255,255,0.4) 0 1px 0;
- text-shadow: #addc7e 0 1px 0;
- color: #ffffff;
- font-family: helvetica, serif;
- padding: 8.5px 18px;
- font-size: 14px;
- text-decoration: none;
- vertical-align: middle;
- }
- .submit-button:hover {
- border: 1px solid #447314;
- text-shadow: #31540c 0 1px 0;
- background: #6aa436;
- background: -webkit-gradient(linear, left top, left bottom, from(#8dc059), to(#6aa436));
- background: -webkit-linear-gradient(top, #8dc059, #6aa436);
- background: -moz-linear-gradient(top, #8dc059, #6aa436);
- background: -ms-linear-gradient(top, #8dc059, #6aa436);
- background: -o-linear-gradient(top, #8dc059, #6aa436);
- background-image: -ms-linear-gradient(top, #8dc059 0%, #6aa436 100%);
- color: #fff;
- }
- .submit-button:active {
- text-shadow: #31540c 0 1px 0;
- border: 1px solid #447314;
- background: #8dc059;
- background: -webkit-gradient(linear, left top, left bottom, from(#6aa436), to(#6aa436));
- background: -webkit-linear-gradient(top, #6aa436, #8dc059);
- background: -moz-linear-gradient(top, #6aa436, #8dc059);
- background: -ms-linear-gradient(top, #6aa436, #8dc059);
- background: -o-linear-gradient(top, #6aa436, #8dc059);
- background-image: -ms-linear-gradient(top, #6aa436 0%, #8dc059 100%);
- color: #fff;
- }
- a:link, a:visited {
- text-decoration:inherit;
- color:#069;
- }
- a:hover {
- text-decoration: underline;
- color: #069;
- }
- a:active {
- text-decoration: none
- }
- </style>
- <div class="form-container">
- <div class="form-title"><h2>Torrent Enviado Com Sucesso</h2></div>
- <div class="form-title">Redirecionando Usuário em 5 segundos</div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement