Jump to content

Recommended Posts

i am able to login successfully using curl to my favorite site forums.asdf.com

 

however, i can only see the site by using printing the results in my localhost.

 

is it possible to send the login, password to the actual forums.asdf.com

 

so that i can directly begin browsing forums.asdf.com instead of using file_get_contents() each time ? this is highly inefficient.

no i am not interested in echoing the results....

 

the script works fine. it logs me in alright. but i would like to be redirected to the site where i am logged in....not echoing it back on my localhost because that consumes memory and a lot of bandwith.

 

my question is, how can i directly send a POST with the http header containing username and password to the desired website.

 

so i shouldn't need to echo or print any results, because after the POST, i will be logged in and already at the desired website.

 

function hitForm($loginURL, $loginFields, $referer="") {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
        curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
        curl_setopt($ch, CURLOPT_URL, $loginURL);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_REFERER, $referer);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $loginFields);
        $ret = curl_exec($ch);
        curl_close($ch);
        return $ret;
}

 

i would like a function to directly redirect me to the desired site and log me in.

Guest
This topic is now 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.