cURL / Mailing Lists / curl-users / Single Mail

curl-users

curllogin into vBulletin help

From: Eget Eget <info.eget_at_gmail.com>
Date: Thu, 2 Jul 2009 15:53:15 +0200

Hi,
I have one big proble with curl and vBullein forum. It is killing, I am
going crazy about it. Could you help me? I tried everything I know and could
find.

I have script which should post threads to forum from my page. I tried to
login into phpBB an it worked just fine but when I try to login into
vBulletin forum, it doesn't work. I have this script:

$md5Pass = md5($_POST["pass"]);
$user=$_POST["ucet"];
$data = "do=login&url=/newthread.php?
do=newthread&amp;f=25&vb_login_md5password=$md5Pass&vb_login_username=$user&cookieuser=1&securitytoken=guest";
curl_setopt($ch, CURLOPT_REFERRER, "mypage");
curl_setopt ($ch, CURLOPT_URL, "http://forum.org/login.php?do=login");
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01;
Windows NT 5.0)");
curl_setopt ($ch, CURLOPT_TIMEOUT, '10');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies/cookie_1.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies/cookie_1.txt");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$store = curl_exec ($ch);

When I let $store echo out, it showing me I was successfully logged in and
it will redirect me to url page, but when it does or when I try to do
another script (curl_setopt($ch, CURLOPT_URL, "page I want to post in");
$content = curl_exec ($ch);) it shows me "Your submission could not be
processed because you have logged in since the previous page was
loaded.Please push the back button and reload the previous window."
I only assume it's something wrong with cookies.

Could you help me please?

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-07-02