cURL
Posted: Mon Oct 17, 2005 4:12 pm
woot my first expierence with cURL and its a lot crazier than i thought. i think i have sucessfully logged into a website using this:
questions!
1) How do i then follow it to the page that it would go to and echo that page out?
2) How would i navigate to another page and echo that fun stuff out?
no further questions
edit:
never mind i have no idea what i am doing. i even tried using fsockopen and i am getting nothing returned but no errors either. this is teh fsockopen script i am trying
this returns nothing but 2 empty elements. keep in mind i am trying to login to a https site. help please...
feyd | removed username and password
Code: Select all
$url = 'WEBSITE';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "uname=USERNAME&pw=PASSWORD");
curl_exec ($ch);1) How do i then follow it to the page that it would go to and echo that page out?
2) How would i navigate to another page and echo that fun stuff out?
no further questions
edit:
never mind i have no idea what i am doing. i even tried using fsockopen and i am getting nothing returned but no errors either. this is teh fsockopen script i am trying
Code: Select all
$site = "members.cj.com";
$url = "/member/foundation/memberlogin.do";
$req = "uname=someone@somewhere.ext&pw=password";
$header = "POST $url HTTPS/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= 'Content-Length: ' . strlen($req) . "\r\n\r\n";
$fp = fsockopen ($site, 443, $errno, $errstr, 30);
if (!$fp)
die("I couldn't connect to $site");
fputs ($fp, $header);
while ( !feof($fp) )
$response[] = fread($fp, 1024);
dump($response);//printr and whatnot the arrayfeyd | removed username and password