Ir para conteúdo
Fórum Script Brasil
  • 0

Gerador de LInk


Lucas Appr

Pergunta

Olá galera, hoje eu comprei uma conta premium no megaupload, e gostaria de criar um gerador de link premium em php.

eu tenho este codigo, abaixo, e gostaria em transforma-lo em um formulario, que a pessoa digitasse o link em um text field, e ele automaticamente mandasse o link para este gerador abaixo, e em vez de ele ir ate o gerador.php para exibir o link, exibir abaixo do campo text field com o link.

-- gerador.php --

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?php
function curl($link, $postfields, $cookie)
{
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
if($postfields)
{
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "login=1&redir=1&username=usuario&password=senha");
}
if($cookie)
{
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
}
$page = curl_exec($ch);
return($page);
curl_close($ch);
}               

$cookie = 'cookie'; //Create a random named cookie file
$page = curl($_POST['link'], $_POST['postfields'], $cookie); //Call the curl function with our arguments
$page = curl('http://www.megaupload.com/?d=OBVHIX69', '', $cookie); //Go to the download page, with no postfields and premium cookie!
preg_match("<a href=\"(.*?)\" onclick=\"\" style=\"font-size:15px;\">", $page, $match);
$link = $match[1]; //Ultimate, we stored the actual link in the $link
var_dump($link); 

 echo "<b><a href='".$link."'>".$link."</a></b><br>"; 

@unlink($cookie); //Important, we need delete the cookie file!

?>
<body>
</body>
</html>

em algum lugar existe um erro, se alguém puder me ajudar, agradeço muito!

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...