Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <code>
- if($acao == 'download')
- {
- $nome_completo = addslashes(trim(@$_POST['nome_completo']));
- $email = addslashes(trim(@$_POST['email']));
- if($nome_completo == '') $mensagem .= 'Informe seu Nome.<br>';
- if($email == '') $mensagem .= 'Informe seu Email.<br>';
- if($mensagem == '')
- {
- $sql = "SELECT * FROM tb_cliente WHERE email = '" . $email . "'";
- $query = mysql_query($sql);
- $conta = mysql_affected_rows();
- if($conta > 0)
- {
- $sql =
- "UPDATE tb_cliente SET
- nome_completo = '$nome_completo'
- WHERE email = '" . $email . "'";
- $query = mysql_query($sql);
- }
- else
- {
- $sql =
- "INSERT INTO tb_cliente
- (nome_completo, email)
- VALUES
- ('$nome_completo', '$email')";
- $query = mysql_query($sql);
- }
- //$hash = md5(time());
- //$_SESSION['hash'] = $hash;
- //$exibir_form = false;
- //$mensagem = '<a href="downarq.php?h=' . $hash . '" target="_blank">Clique aqui para iniciar o download.</a>';
- $arquivo = 'AdmFinance.exe';
- header ("Content-Disposition: attachment; filename=".$arquivo."");
- header ("Content-Type: application/octet-stream");
- header ("Content-Length: ".filesize('downloads/'.$arquivo));
- readfile($link);
- }
- }
- </code>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement