下雨看世界
2016-02-27 13:13
<html>
<head>
<meta charset = 'utf-8' />
<title>确认验证码</title>
</head>
<body>
<form method = "POST" action =./form.php>
<p>验证码图片:<img border = "1" src = "./identifyCode.php?r=<?php echo rand();?>" width ="100" height= "30" /></p>
<p>请输入图片上的内容:<input type = "text" name = "authcode" value = "" /> </p>
<p><input type = "submit" value = "提交" style = "padding:6px 20px;"></p>
</form>
</body>
</html>
前端代码显示正常,为什么加入了下面的代码,前端表单代码就显示不出来了?
<?php
header("Content-type:text/html;charset=utf-8");
if(isset($_REQUEST['authcode'])){
session_start();
if (strtolower($_REQUEST['authcode']) == $_SESSION['authcode']) {
echo '<font color="#0000CC">输入正确</font>';
}else{
echo '<font color="#CC0000"><b>输入错误</b></font>';
}
}
exit();
?>
我的也是这样,问题解决了,谢谢哥们的指教。
<html>
<head>
<meta charset = 'utf-8' />
<title>确认验证码</title>
</head>
<body>
<form method = "POST" action =./form.php>
<p>验证码图片:<img border = "1" src = "./captcha_cn4.php?r=<?php echo rand();?>" width ="100" height= "30" /></p>
<p>请输入图片上的内容:<input type = "text" name = "authcode" value = "" /> </p>
<p><input type = "submit" value = "提交" style = "padding:6px 20px;"></p>
</form>
</body>
</html>
<?php
header("Content-type:text/html;charset=utf-8");
if(isset($_REQUEST['authcode'])){
session_start();
if (strtolower($_REQUEST['authcode']) == $_SESSION['authcode']) {
echo '<font color="#0000CC">输入正确</font>';
}else{
echo '<font color="#CC0000"><b>输入错误</b></font>';
}
}
exit();
?>
把标出来部分换成我的地址,显示是正常的。
清下缓存,或换个浏览器试试
PHP实现验证码制作
37916 学习 · 321 问题
相似问题