0 レビュー
0 回答
java-JcaptchaとCurl
私はcurlPHPを使用してJcaptchaから画像を取得しています。
hidCaptchaIDはJcaptchaによって生成されます。
問題は、無効なキャプチャコードというエラーが表示され続けることです。入力したキャプチャが正しいことはわかっています。
curlを使用してhidCaptchaID、inCaptchaChars、その他のデータを送信しています
firefox firebugからのヘッダーリクエストを確認しましたが、実際にはCURL経由で送信するのと同じです。セッションとCookieも同じです。
何が問題になる可能性がありますか?
注:私の質問は、キャプチャバイパス/ブレーカーとは何の関係もありません。キャプチャコードを手動で入力してから、curlを使用して送信します。
コード:
<?php
$cookiesPath = "c:/wamp/www/cookies";
$a = session_id();
if ($a == '') session_start();
if ($_GET) {
$form_link = $_GET['newURL'];
unset($_GET['newURL']);
$postDataCapcha = http_build_query($_GET);
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "\BuiltinObjectToken-VerisignClass3xxxxxxxxxxxxxxxxxxxxxxx.crt");
curl_setopt($ch, CURLOPT_URL, "https://xxxxx.xxxxx.co.uk/xxxxx/xxxxx/" . $form_link );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $postDataCapcha);
curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE);
curl_setopt($ch, CURLOPT_COOKIE, "JSESSIONID=xxxxxxxxxxxxx:xxxxxxxxx");
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiesPath . "/cookiefile.txt");
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiesPath . "/cookiefile.txt");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$PagaeCapcha = curl_exec($ch);
echo "<hr><br />";
echo($PagaeCapcha);
exit();
}
<form action="index.php" method="get">
Number: <br />
<input name="existing_mobile_number" id="existing_mobile_number" type="text">
<br /><br />
Customer Postcode:<br />
<input name="customer_postcode" id="customer_postcode" type="text">
<br /><br />
Capcha Code:<br />
<input id="captchauserid" name="inCaptchaChars" type="text">
<input name="hidCaptchaID" value="<?php echo $capcha_id['0']->value; ?>" type="hidden" />
<input name="newURL" type="hidden" value="<?php echo $capchalink; ?>" />
<input value="Go!" type="submit" />
</form>
わからない
同様の質問
私たちのウェブサイトで同様の質問で答えを見つけてください。