Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Application and Web Development > PHP

Reply
 
LinkBack Thread Tools Display Modes
Old 07-01-2009, 10:49 AM   #1 (permalink)
Eget25
Recruit
 
Join Date: Apr 2009
Posts: 6
Eget25 is on a distinguished road
Curl login into vBulletin please help

Hi,
I have one big problem 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 thread to forum from my page. I tried to login into phpBB forum and it worked just fine but when I try to login into vBulletin forum, it doesn't work. I have this script:

Code:
$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 that I was successfully login and it will redirect me to url page, but when it does or when I try to do another script
Code:
(curl_setopt($ch, CURLOPT_URL, "page I want to post in"); $content = curl_exec ($ch);)
it shows me
Code:
"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?
Eget25 is offline   Reply With Quote
Old 07-01-2009, 06:54 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,706
sde is on a distinguished road
my guess is that it's reading your cookie script and automatically logging you in.
__________________
Mike
sde is offline   Reply With Quote
Old 07-02-2009, 12:06 AM   #3 (permalink)
Eget25
Recruit
 
Join Date: Apr 2009
Posts: 6
Eget25 is on a distinguished road
So why when I go to another page, it shows me that I am not logged in?
Eget25 is offline   Reply With Quote
Old 07-02-2009, 05:12 PM   #4 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 840
DJMaze is on a distinguished road
You forgot to forward the cookie header?
__________________

UT: Ultra-kill... God like!
DJMaze is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
vbulletin time is weird sde PHP 2 03-03-2003 06:27 PM
VBulletin Upgrade sde Lounge 5 02-18-2003 02:45 AM
VBulletin? sde Lounge 5 06-05-2002 08:08 PM


All times are GMT -8. The time now is 11:19 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting