1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| <?php
$url='http://www.server.com/login.php';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result= curl_exec($ch);
//ICI J'AI ECRIT LE CODE QUI RETROUVE L'URL DE LA CAPTCHA ET LE MET DANS $img
echo '<img src=' . $img . '>';
?>
<html>
<FORM method="POST" name="whatever" action="">
<input type="text" name="cap" value="" id="cap"><input type="submit" name="submit">
</form>
</html>
<?php
if(isset($_POST['submit'])){
$captcha=$_POST['cap'];
$user="user";
$pass="pass";
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, "username=$user&password=$pass&captcha=$captcha");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result= curl_exec($ch);
echo $result;
curl_close($ch);}
?> |
Partager