Php curl problem -
<?php set_time_limit(0); $php_userid = "my yahoo id"; $php_password = "my yahoo password"; $agent = "mozilla/5.0 (windows; u; windows nt 5.0; en-us; rv:1.4) gecko/20030624 netscape/7.1 (ax)"; $reffer = "http://mail.yahoo.com/"; $loginurl = "https://login.yahoo.com/config/login?"; $postfields = ".tries=1&.src=ym&.intl=us&.u=3jtlosl6ju4sc.v=0&.challenge=nzyhs1spj7zunovhpd6krnqaf5kz&hasmsgr=0&.chkp=y&.done=http://mail.yahoo.com&.pd=ym_ver=0&c=&ivt=&sg=&pad=3&aad=3&login".$php_userid."&passwd".$php_password.""; $ch = curl_init(); curl_setopt($ch, curlopt_url,$loginurl); curl_setopt($ch, curlopt_useragent, $agent); curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields,$postfields); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_followlocation, 1); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_ssl_verifyhost, 0); curl_setopt($ch, curlopt_referer, $reffer); $result = curl_exec ($ch); curl_close ($ch); echo $result; ?>
is there error? i'm doing wrong, can not find it. please let me know if can see error? need set curl class.
the post data malformed, should :
[...] "login=" . urlencode($php_userid). "&passwd=" . urlencode($php_password) . ""
instead of
[...] "login".$php_userid."&passwd".$php_password.""
you should use urlencode ensure data passed in post data sent , missing =
login , passwd value.
Comments
Post a Comment