NoobKiller Posted October 27, 2007 at 10:15 PM Report Share #143371 Posted October 27, 2007 at 10:15 PM 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 More sharing options...
karva Posted October 27, 2007 at 11:51 PM Report Share #143391 Posted October 27, 2007 at 11:51 PM Isso quer dizer que a linha $space = explode("InitializeDownload('", $result); não está a retornar nada. Experimenta a seguir a isso, por um var_dump($space); Proud LEIC-A@IST student! Link to comment Share on other sites More sharing options...
NoobKiller Posted October 28, 2007 at 08:15 AM Author Report Share #143422 Posted October 28, 2007 at 08:15 AM boas depois de colocar o vardump recebi este erro Notice: Undefined offset: 1 in C:\Documents and Settings\Ambiente de trabalho\server php\www\saca.php on line 27 string(0) "" Link to comment Share on other sites More sharing options...
NoobKiller Posted October 28, 2007 at 08:39 AM Author Report Share #143424 Posted October 28, 2007 at 08:39 AM ja consegui o que rpetendi ^^ tanks pela ajuda na mesma karva 😄 Link to comment Share on other sites More sharing options...
Gurzi Posted October 28, 2007 at 11:21 AM Report Share #143469 Posted October 28, 2007 at 11:21 AM ja consegui o que rpetendi ^^ tanks pela ajuda na mesma karva 😄 Posta a solução para ajuda a futuros utilizadores com o mesmo erro por favor. Link to comment Share on other sites More sharing options...
NoobKiller Posted October 31, 2007 at 09:31 PM Author Report Share #144359 Posted October 31, 2007 at 09:31 PM desculpa a demora so agora aqui vim 😛 o problema estava nesta linha $post = 'lc_email='.$n_cliente.'&lc_pin='.$password.'&lc_signin=Sign-In'; como tava a carregar no botão de login obvio que não ia fazelo xD Link to comment Share on other sites More sharing options...
electric Posted November 5, 2007 at 11:14 AM Report Share #145336 Posted November 5, 2007 at 11:14 AM 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 More sharing options...
electric Posted November 5, 2007 at 05:25 PM Report Share #145386 Posted November 5, 2007 at 05:25 PM Boas não estou é a conseguir entrar no MS usando o curl :s alguem sabe o que se podera estar a passar ? o codigo esta certo :s apena sn consigo logar atravez dele :s Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now