Results 1 to 2 of 2

Thread: Curls posting to a Punbb Register Forum

  1. #1
    Join Date
    Dec 2008
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Curls posting to a Punbb Register Forum

    Hi all,

    I'm trying to post my values from my login form to the punbb form using curls.

    How would I trick the punbb forum in the time taken?

    I get the following message how would I prevent this problem?

    "Unable to confirm security token. A likely cause for this is that some time passed between when you first entered the page and when you submitted a form or clicked a link. If that is the case and you would like to continue with your action, please click the Confirm button. Otherwise, you should click the Cancel button to return to where you were."



    $Curl_Session = curl_init('http://www.punbb.co.za/Forums/register.php');

    curl_setopt ($Curl_Session, CURLOPT_POST, 1);
    curl_setopt ($Curl_Session,
    CURLOPT_POSTFIELDS, "req_username=Gascan&req_email1=steve@gmail.com&req_password1=gascan&req_password2=gascan");

    curl_setopt ($Curl_Session, CURLOPT_FOLLOWLOCATION, 1);
    curl_exec ($Curl_Session);
    curl_close ($Curl_Session);

    Thanks Stephen

  2. #2
    Join Date
    Aug 2007
    Location
    Ohio
    Posts
    79
    Thanks
    0
    Thanked 15 Times in 15 Posts

    Default

    I'm not familiar with PunBB or it's security mechanisms, but you more than likely all you need to do is load the page with the form, and make sure you're accepting any cookies. That can be done through the CURLOPT_COOKIEJAR and CURLOPT_COOKIEFILE options.

    So if the register.php is the same location as the form actual users would fill out to register, you would want to load that first without sending any registration information, and then again with the registration information.

    This way the system will log your request, set a session; then when you load again with the post data and the cookies w/ the session data, the script will accept your data.
    Last edited by jackbenimble4; 01-04-2009 at 05:00 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •