作者iozz (我爱这里!)
看板PHP
标题[请益] 图形验证的功能
时间Fri Oct 1 19:18:23 2010
当我正确输入图片验证码时
Verify failed. correct code is "图片显示的code", you typed
"key in的code"
後者应该要显示我输入的code,可是却一直出现空白?
完整测试档
http://140.116.5.200/~q3697405/test.rar
其中verify.html可以验证图形验证可以执行
可是整合到我的contact-us.html就一直出现上述问题
是不是下面的程式档哪里出现了问题呢?
1.验证的php档
<?php
session_start();
$ara = explode("|", $_SESSION['vCode']);
if($ara[0] == $_POST['code']){
echo("Verify Success. code is ".$ara[0]);
}else{
echo("Verify failed. correct code is ".$ara[0].", you typed
".$_POST['code']);
}
?>
2.html的表单内容
<!-- start the Contact form -->
<form name="contact_form" method="post" class="vs3form" onSubmit="return
check();" action="verify_check.php">
<fieldset>
<legend>Compose Your Message</legend>
<table cellpadding="0" cellspacing="0" border="0" summary="Contact Us">
<!--图形验证机制的换图-->
<tr>
<td></td>
<td><span class="captcha_image">
<img src="verify_image.php" alt="点此刷新验证码" name="verify_code"
width="150" height="60" border="0" id="verify_code"
onclick="document.getElementById('verify_code').src='verify_image.php?' +
Math.random();" style="FILTER:
wave(add=0,freq=3,lightstrength=50,phase=0,strength=3);cursor:pointer;" /><br
/>
<br />Please enter characters you see above in the box below to validate this
form.</span>
</td>
</tr>
<tr>
<td><label for="captcha_response">Characters</label></td>
<td><input type="text" class="textbox" id="captcha_response"
name="captcha_response"> </td>
</tr>
</table>
</fieldset>
</form>
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.39.5.78