Hi, Im trying to recieve information from a site, www.dreamteamfc.com. the site requires a login and i'm trying to spoof this with curl in order to get the info of my main page, but the site never accepts the login.
here are the essential details of the POST form on the login page i'm trying to spoof:
<form method="post" action="http://www.dreamteamfc.com/dtfc05i/servlet/OpenFSELogin">
<input type="hidden" name="enter.x" value="y">
<input type="hidden" name="gameid" value="183">
<input type="hidden" name="homeid" value="">
<input type="hidden" name="dummy" value="none">
<input type="hidden" name="password" value="none">
<input type="text" name="username">
</form>
and here is the PHP code i'm trying, and failing, to spoof the login with:
(the asterisks represent my login PIN number)
$ch = curl_init();
$request=array();
$request['enter_x']=urlencode('y');
$request['gameid']=urlencode('183');
$request['homeid']=urlencode('');
$request['dummy']=urlencode('none');
$request['password']=urlencode('none');
$request['username']=urlencode('*************');
curl_setopt($ch, CURLOPT_URL, "http://www.dreamteamfc.com/dtfc05i/servlet/OpenFSELogin");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_REFERER, "http://www.dreamteamfc.com/dtfc05i/servlet/OpenFSELogin");
$output = curl_exec($ch);
curl_close($ch);
why does this not work??!!? if i host a page containing just the form above, i can log on no trouble. but when i try to cURL it, it never works. Aaargh!
thanks in advance, sp00n