Jump to content

Curl em conta MS


NoobKiller

Recommended Posts

ola ppl andei por ai a ver ajudas e achei o forum 😉 espero que me possam ajudar 😄

então e assim

eu queria usar o curl na minha conta Megashare, so que depois de colocar o meu codigo fico com uma pagina em branco

<?php
error_reporting(E_ALL);
//obter dados
$login = "xxxx";
$password = "xxxx";
$referer = "http://megashare.com";
$post = 'lc_email='.$login.'&lc_pin='.$password; 
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
$cookies = "cookies.txt";
$url = "http://megashare.com";
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS,$post); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);
$result = curl_exec($ch);
//$result2 = curl_errno($ch);
curl_close ($ch);
//tratar a informação
$space = explode("InitializeDownload('", $result);
$space = explode("');", $space[1]);
$space = $space[0];
echo $space;
?>

dava pagina em branco então addicionei a linha

error_reporting(E_ALL);

e deu este erro:

Notice: Undefined offset: 1 in C:\Documents and Settings\Ambiente de trabalho\server php\www\saca.php on line 27

e a linha 27 é

$space = explode("');", $space[1]);

espeo k me possam ajudar 😄

Link to comment
Share on other sites

boas ppl estou a usar paret deste codigo e mudei de host... este host diz que tem o curl td bonito instalado apesar disso dame este erro:

Code=php]
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in *** on line 177

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in *** on line 193

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in *** on line 208

Notice: Undefined offset: 1 in *** on line 217
string(0) ""

em que os 3 1º erros são daqui:

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

se mudar de 1 para 0 ja não da erro mas havera algum problema ?

o ultimo erro devira daqui:

$direct_link = explode("');", $direct_link[1]);

e por fim fiz 1 vardump da var $direct_link e deu string (0)

o que faça ? :s sera do host ? sera de mim ? é que noutros servidores isto dava bem mas não podera haver alterações que possa fazr ? pah é k os gajos do host são 1s chatos -.-

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.