Page 1 of 1

[PHP][CURL] Problem

Posted: Sun May 09, 2010 7:11 am
by Mark Transer
As the topic I have a problem with my script because they do not log on or engaged in any activity which he commanded. Just does not do anything what to do.
My script:

Code: Select all

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.prisonwars.pl/');
curl_setopt($ch, CURLOPT_USERAGENT, 'Opera/9.80 (Windows NT 5.1; U; pl) Presto/2.5.24 Version/10.53' );
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, 'login=mylogin&password=mypassword&log_in=1');
curl_setopt($ch, CURLOPT_COOKIEFILE, './cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR,'./cookie.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_URL, 'http://alcatraz.prisonwars.pl/bank/');
curl_setopt($ch, CURLOPT_USERAGENT, 'Opera/9.80 (Windows NT 5.1; U; pl) Presto/2.5.24 Version/10.53' );
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, 'name=dep&');
curl_setopt($ch, CURLOPT_COOKIEFILE, './cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR,'./cookie.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

$store = curl_exec ($ch);
echo $store;  //test
curl_close($ch);
?>
Script on the page login:
<form action='http://www.prisonwars.pl/' method='post'>
<input type='hidden' name='log_in' value='1'>
<div class="loginDiv"><img src='http://www.prisonwars.pl/gfx/lay/pl/login.gif' alt="" /></div>
<div class="loginDiv"><input type='text' name='login' class='loginForm' /></div>
<div class="loginDiv"><img src='http://www.prisonwars.pl/gfx/lay/pl/password.gif' alt="" /></div>
<div class="loginDiv"><input type='password' name='password' class='loginForm' /></div>
<div class="submitDiv"><input type='image' src='http://www.prisonwars.pl/gfx/forms/pl/login.png' /></div>
<div class="clear"></div>
</form>
The second script on the page:
<form action='http://alcatraz.prisonwars.pl/bank/' method='post'>
<table>
<tr>
<td>

<input type='hidden' name='dep' value='1'>
<input type='text' name='value' value='0' class='formText'>
</td>
<td>
<input type="submit" value='WPLAC' class='formSubmit' title='Trzymaj szmal w banku'>

</td>
</tr>
</table>
</form>