
28-01-2012, 20:19:36
|
| |
Php de Curl ile üye girişi yapma Sorunu! | | PHP- Kodu: <?php
$kullanici_adi ='mail@hotmail.com';
$sifre = '123123';
$sayfa="https://www.adres.com/alt/mainMenu.html";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$sayfa);
curl_setopt($ch, CURLOPT_COOKIEJAR,"cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE,"cookies.txt");
curl_setopt($ch, CURLOPT_REFERER,$sayfa);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"j_username=$kullanici_adi&j_password=$sifre&login=LOGİN");
curl_exec($ch);
curl_setopt($ch, CURLOPT_URL,$sayfa);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$data=curl_exec($ch);
curl_close($ch);
echo $data;
?>
Çektiğim yerdeki kaynak kodlar; PHP- Kodu: <form method="post" id="loginForm" action="/edestek/j_security_check">
<table >
<tr>
<td width="18%">E-Posta Adresi</td>
<td><div class="formtext_box" style="width:200px"><div class="formtext_box_l"><div class="formtext_box_r">
<input name="j_username" id="j_username" type="text" class="input_txt" value="" /></div></div></div></td>
</tr>
<tr>
<td>Şifre </td>
<td><div class="formtext_box" style="width:200px"><div class="formtext_box_l"><div class="formtext_box_r">
<input name="j_password" id="j_password" type="password" class="input_txt" value="" /></div></div></div></td>
</tr>
</table>
<div class="btn_sumbit" align="right" style="position:relative; right:15px;"><input type="image" src="images/images_ihs_sitemesh/btn_giris.gif" width="89" height="26" alt="Devam" hspace="5" vspace="6" /></div>
</form>
|