Status
Not open for further replies.

xwarlordx

Active Member
152
2008
0
0
i need help with curl to login to ipb forum board ..please check ..problem with the code below ..the user is not logined in the output ..displays the login page

Code:
<?php
$User="*****";
$Pass="******";
$url="http:///****.com/forums/index.php?app=core&module=global&section=login";
$ch = curl_init($url);
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "username=".$User."&password=".$Pass."");
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
$result= curl_exec ($ch);
curl_close ($ch);
print $result;
?>
 
3 comments
Emm! It must be ipb 3.1.x + ? right?

You need to get the security tokens first

Curl the page without posting anything
Then parse the security tokens (use LiveHttpHeaders or HTTP Fox to track)
Then post the securitytokens along with username and password

Security tokens are requireds to login in ipb 3.1.x
 
Status
Not open for further replies.
Back
Top