我需要使用CURL來顯示來自url的圖像。但運行此代碼後,我只能獲取文本數據。沒有圖像顯示?在$一個含有驗證碼圖像,我希望用戶通過看image.plz幫助填寫驗證碼...從curl結果中提取圖像
curl_setopt($ch, CURLOPT_USERAGENT,$usergaent);
curl_setopt($ch, CURLOPT_URL, 'http://sitproject.com/verification.asp?source=login');
curl_setopt ($ch, CURLOPT_HTTPHEADER, $httpheader);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch,CURLOPT_REFERER,"http://site2sms.com/login.asp");
$one = curl_exec($ch);
echo $one;
while debugging $one contains this only no binary image data:
<body>
<div class="success">Thanks for using Sitproject.Com! You are logged into your Account Successfully to Proceed Further Please Enter Below Displayed 3 Digits Security Code in the Input Box!</div>
<table width="1079" height="54" border="0">
<tr>
<td>
<img src="security/captcha.asp" />
<br />
Please Type the 3 Digits Displayed above in the Image and Click on Proceed Further Button to use the Free Services?
<br />
<form name="frmVerify" action="auth.asp" method="post">
<input type="hidden" name="txtSource" value="captcha" />
<input type="text" name="txtCaptcha" maxlength="3" />
<input type="submit" value="Proceed Further" />
</form>
</td>
</tr>
<tr>
<td>Note: If you are having any problem with Security Code you can mail us at [email protected]!</td>
</tr>
</table>
</body>
您是否已經在HTML響應中讀取了消息...? – CBroe