asked on
<?php
$url_login = 'https://www.name.com/account/login.php';
$url_content = 'https://www.name.com/management/list_domain.php';
$dh_username = 'user@domain.com';
$dh_password = 'password';
$dh_post = 'acct_name='.$dh_username.'&password='.$dh_password.'&x=0&y=0';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url_login);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $dh_post);
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$store = curl_exec ($ch);
curl_setopt($ch, CURLOPT_URL, $url_bckuser);
$content = curl_exec ($ch);
curl_close ($ch);
//Do whatever I need to with the content
echo $content;
?>
https://www.name.com/account/login_u.php?redir_location=/
POST /account/login_u.php?redir_location=/ HTTP/1.1
Host: www.name.com
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.6) Gecko/2009020911 Ubuntu/8.10 (intrepid) Firefox/3.0.6
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: https://www.name.com/
Cookie: __utmz=225248517.1235958945.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=225248517.4480966728181928000.1235958945.1235967785.1236006591.3; PHPSESSID=lam68h994dpglr725vh0qefvs0; __utmb=225248517.3.10.1236006591; __utmc=225248517
Content-Type: application/x-www-form-urlencoded
Content-Length: 63
acct_name=user%40domain.com&password=password&x=27&y=1