Jump to content

loging into proboards using curl


Recommended Posts

There is a proboards site i like to visit. However, its been blocked at my work. I was trying to find a way of logging into it via my site and using that to read the proboards site. I dont really need to post or anything, just something to read when i get bored.


I want to keep the name of the site secret. However this is my code. Note: When i run the code i get a blank page. Nothing at all happens.



function login($website,$username,$password){

$post_data = array(

                "action" => "login2",
	"minutes" => "-1",
	"username" => $username,
	"password" => $password,



function Post_thread($url,$post_data){

$options = array(
        CURLOPT_COOKIEJAR => "/tmp/cookies.txt",       // where we store the cookie.
        CURLOPT_COOKIEFILE => "/tmp/cookies.txt",      // to pass the cookie if we need too.
        CURLOPT_RETURNTRANSFER => true,     // return web page
        CURLOPT_HEADER         => false,    // don't return headers
        CURLOPT_FOLLOWLOCATION => true,     // follow redirects
        CURLOPT_ENCODING       => "",       // handle all encodings
        CURLOPT_USERAGENT      => "spider", // who am i
        CURLOPT_AUTOREFERER    => true,     // set referer on redirect
        //CURLOPT_REFERER        => $url, //spoof the referer
        CURLOPT_CONNECTTIMEOUT => 120,      // timeout on connect
        CURLOPT_TIMEOUT        => 120,      // timeout on response
        CURLOPT_MAXREDIRS      => 10,       // stop after 10 redirects
        CURLOPT_POST => true,               // we want to post some data
        CURLOPT_POSTFIELDS => $post_data,  //array of what we want to post
    $ch      = curl_init( $url );
    curl_setopt_array( $ch, $options );
    $content = curl_exec( $ch );
    echo $content;
    $errmsg  = curl_error( $ch );
    echo $errmsg;




Link to comment
Share on other sites

I got it working anyway.  8) I still have a small problem. I used HTTP live headers firefox extension to capture the headers when i start a thread. I brings back something like this


Content-Disposition: form-data; name="title"

Filme 2010, filme 2009, filme noi, programe TV, program cinema, premiere cinema, trailere filme - CineMagia.ro
Content-Disposition: form-data; name="category"

Content-Disposition: form-data; name="tags"

filme, programe tv, program cinema
Content-Disposition: form-data; name="bodytext"

Filme 2010, filme 2009, filme noi, programe TV, program cinema, premiere cinema, trailere filme
Content-Disposition: form-data; name="trackback"

Content-Disposition: form-data; name="url"

Content-Disposition: form-data; name="phase"

Content-Disposition: form-data; name="randkey"

Content-Disposition: form-data; name="id"



how do you use curl to post data like that? Usually i just use name=blah&message=blah  i dont know how to emulate this Content disposition stuff.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.