cURL to login to a website!

Hello!

I would like to use cURL to login to the website: lockerz.com

I have some code, but it doesn’t seem to work:
[php]<?php
// INIT CURL
$ch = curl_init();

// SET URL FOR THE POST FORM LOGIN
curl_setopt($ch, CURLOPT_URL, ‘http://lockerz.com/auth/login’);

// ENABLE HTTP POST
curl_setopt ($ch, CURLOPT_POST, 1);

// SET POST PARAMETERS : FORM VALUES FOR EACH FIELD
curl_setopt ($ch, CURLOPT_POSTFIELDS, ‘[email protected]&password-password=PASSWPRD’);

// IMITATE CLASSIC BROWSER’S BEHAVIOUR : HANDLE COOKIES
curl_setopt ($ch, CURLOPT_COOKIEJAR, ‘cookie.txt’);

Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL

not to print out the results of its query.

Instead, it will return the results as a string return value

from curl_exec() instead of the usual true/false.

curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

// EXECUTE 1st REQUEST (FORM LOGIN)
$store = curl_exec ($ch);

// SET FILE TO DOWNLOAD
curl_setopt($ch, CURLOPT_URL, ‘http://lockerz.com//auth/login’);

// EXECUTE 2nd REQUEST (FILE DOWNLOAD)
$content = curl_exec ($ch);

// CLOSE CURL
curl_close ($ch);
echo $content;
?>[/php]

Thank you very much if you can help!

Oh and I want to download the page: http://lockerz.com/auction

( I want to have it’s content)

Thanks !!!

Sponsor our Newsletter | Privacy Policy | Terms of Service