PHP cURL odd behaviour -


i'm trying parse page i've first log site username , password. started php curl script log page using method, problem i'm receiving timeout error everytime, long timeout period set.

login page: http://myaccount.comeconnect.com/jsp/login.jsp

url used in curl: http://myaccount.comeconnect.com/servlet/myaccountlogin?loginmode=2&username=user&password=pass&quicknavigation=disabled

with valid, user , pass values.

now when use url in browser, logged in easily. i'm little confused why i'm getting timeout errors.

php code not on same server.

php code:

     //create array of data posted     $post_data['loginmode'] = '2';     $post_data['username'] = $_get['user'];     $post_data['password'] = $_get['pass'];     $post_data['quicknavigation'] = "disabled";      //traverse array , prepare data posting (key1=value1)     foreach ( $post_data $key => $value) {         $post_items[] = $key . '=' . $value;     }      //create final string posted using implode()     $post_string = implode ('&', $post_items); 
$user = $_get['user']; $pass = $_get['pass'];  //create array of data posted  $post_data = array( 'loginmode' => '2',                     'username' => $user,                     'password' => $pass,                     'quicknavigation' => "disabled");   //create final string posted using implode()  $post_string = http_build_query($post_data, '', '&');  //params curl  $ckfile = './cookie.txt';  $url = 'http://myaccount.comeconnect.com/servlet/myaccountlogin?'.$post_string; $timeout=10; $useragent= "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1";  //create curl connection  $ch = curl_init();      curl_setopt($ch, curlopt_useragent, $useragent);     curl_setopt($ch, curlopt_url, $url);     curl_setopt($ch, curlopt_returntransfer, 1);     curl_setopt($ch, curlopt_followlocation, 1);     curl_setopt($ch, curlopt_autoreferer, 1);     curl_setopt($ch, curlopt_timeout,$timeout);      curl_setopt ($ch, curlopt_cookiejar, $ckfile);     $result = curl_exec($ch);  print_r(curl_getinfo($ch)); echo curl_errno($ch) . '-' .curl_error($ch);  curl_close($ch);  echo $result; 

the host myaccount.comeconnect.com appears preventing connections non-customers. you're receiving error because you're not on ip address allowed connect , unfortunately, there no way fix that.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -