Jump to content

cURL login and member action.


waynew

Recommended Posts

Basically, the purpose of the below code is to login to my account and update one of the features on my profile using cURL. The problem however seems to be the case that the site thinks that I don't have cookies enabled. Please note that I'm using a Windows server.

 

<?php
// INIT CURL
$ch = curl_init();

// SET URL FOR THE POST FORM LOGIN
curl_setopt($ch, CURLOPT_URL, 'http://www.bebo.com/SignIn.jsp');


curl_setopt ($ch, CURLOPT_POST, 1);

curl_setopt ($ch, CURLOPT_POSTFIELDS, 'EmailUsername=*****&Password=*******&signin=Sign In');

curl_setopt ($ch, CURLOPT_COOKIEJAR, 'temp/bebocookie.txt');


ob_start();    
$store = curl_exec ($ch);
ob_end_clean(); 
curl_close ($ch);
unset($ch); 

$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEFILE, "temp/bebocookie.txt");
curl_setopt($ch, CURLOPT_URL,"http://www.bebo.com/Saying.jsp?From=Profile&MemberId=4153429001");
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, 'sayingText=Testing&Save=Update');

$result = curl_exec ($ch);
curl_close ($ch);

?>

Link to comment
https://forums.phpfreaks.com/topic/130507-curl-login-and-member-action/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.