Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. <code>
  2.     if($acao == 'download')
  3.      {
  4.  
  5.         $nome_completo = addslashes(trim(@$_POST['nome_completo']));
  6.  
  7.         $email = addslashes(trim(@$_POST['email']));
  8.  
  9.         if($nome_completo == '') $mensagem .= 'Informe seu Nome.<br>';
  10.  
  11.         if($email == '') $mensagem .= 'Informe seu Email.<br>';
  12.  
  13.         if($mensagem == '')
  14.          {
  15.  
  16.                    
  17.  
  18.             $sql = "SELECT * FROM tb_cliente WHERE email = '" . $email . "'";
  19.  
  20.             $query = mysql_query($sql);
  21.  
  22.             $conta = mysql_affected_rows();
  23.                
  24.  
  25.                 if($conta > 0)
  26.                   {
  27.                     $sql =
  28.                       "UPDATE tb_cliente SET
  29.                       nome_completo = '$nome_completo'
  30.                        WHERE email = '" . $email . "'";
  31.                     $query = mysql_query($sql);
  32.                   }
  33.                 else
  34.                   {
  35.                     $sql =
  36.                        "INSERT INTO tb_cliente
  37.                         (nome_completo, email)
  38.                         VALUES
  39.                         ('$nome_completo', '$email')";
  40.                     $query = mysql_query($sql);
  41.                   }
  42.  
  43.  
  44.                 //$hash = md5(time());
  45.                 //$_SESSION['hash'] = $hash;
  46.                                 //$exibir_form = false;
  47.                                 //$mensagem = '<a href="downarq.php?h=' . $hash . '" target="_blank">Clique aqui para iniciar o download.</a>';
  48.  
  49.  
  50. $arquivo = 'AdmFinance.exe';
  51. header ("Content-Disposition: attachment; filename=".$arquivo."");
  52. header ("Content-Type: application/octet-stream");
  53. header ("Content-Length: ".filesize('downloads/'.$arquivo));
  54. readfile($link);
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.           }
  62.  
  63.  
  64.      }
  65.  
  66. </code>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement