OK so I got the problem to login on vbulletin forum. Thi is what i figure out:
function curl($url, $post) {
$curl=curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3');
curl_setopt($curl, CURLOPT_COOKIEFILE, dirname(__FILE__) . '/cookies.txt');
curl_setopt($curl, CURLOPT_COOKIEJAR, dirname(__FILE__) . '/cookies.txt');
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_HEADER, 0);
if(strlen($post)>0)
{
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
}
$strona=curl_exec($curl);
echo $strona;
curl_close($curl);
}
I call the function with:
$urlroot = 'http://www.exemplary-vbulletin-forum.com/login.php?do=login';
$users = array(
$vbulletin1 = array(
'vb_login_username' => 'user_name',
'vb_login_password'=> '',
's' => '',
'securitytoken' => 'guest',
'do'=> 'login',
'vb_login_md5password' => md5('secret_password'),
'vb_login_md5password_utf' => md5('secret_password')
)
);
curl($urlroot, $users[$i]);
When i run my script I got standard vbulletin meesage:
thank you for logging user_name
Afer about 2-3 seconds the script is redirected to the main site of forum which looks like http://www.exemplary-vbulletin-forum.com/index.php?
s is changing on each script running, but i am not logged in, any ideas ???