curl-users
Re: curllogin into vBulletin help
Date: Thu, 2 Jul 2009 23:03:24 +0300
I've used this lines and it worket ok for me.. about a year ago..
curl -b cookies.txt -c cookies.txt -s -S -L -d "vb_login_username='&$sLogin[0]&'&vb_login_password=&s=&securitytoken=guest&do=login&vb_login_md5password='&$MD5pass&'&vb_login_md5password_utf='&$MD5pass&'" "'&$URL&'/login.php?do=login
curl -b cookies.txt -c cookies.txt "'&$URL&'/newthread.php?do=newthread&f='&$f&'"
$LogedInUser=_StringBetween($sOut1,'name="loggedinuser" value="','" />')
$SecurToken =_StringBetween($sOut1,'name="securitytoken" value="','" />')
$PostHash=_StringBetween($sOut1,'name="posthash" value="','" />')
$poststarttime=_StringBetween($sOut1,'name="poststarttime" value="','" />')
curl -v -b cookies.txt -c cookies.txt -s -S -L -d "subject='&$SubjectDet&'&message='&$MassageDet&'&wysiwyg=0&iconid=0&s=&securitytoken='&$SecurToken[0]&'&f='&$f&'&do=postthread&posthash='&$PostHash[0]&'&poststarttime=&loggedinuser='&$LogedInUser[0]&'&sbutton=Submit+New+Thread&parseurl=1&emailupdate=9999&polloptions=4" "'&$URL&'/newthread.php?do=postthread&f='&$f&'"
hope it help.
P.S
everything that has a $ before it is a varibale
----- Original Message -----
From: Eget Eget
To: curl-users_at_cool.haxx.se
Sent: Thursday, July 02, 2009 4:53 PM
Subject: curllogin into vBulletin help
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&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
-------------------------------------------------------------------
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