为了账号安全,请及时绑定邮箱和手机立即绑定

前端form.php

        <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();
?>

正在回答

2 回答

我的也是这样,问题解决了,谢谢哥们的指教。


0 回复 有任何疑惑可以回复我~

        <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();
?>

把标出来部分换成我的地址,显示是正常的。

清下缓存,或换个浏览器试试


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

前端form.php

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信