Heim > Artikel > Backend-Entwicklung > 打击回看看,为什么post过来的数据为空
打击来看看,为什么post过来的数据为空
<br /><form method="post" action="/Thinkphp/admin.php/User/do_login" id="form1" name='form1'><br /> <div class="container"><br /> <div class="content"><br /> <div class="bt"><h1>WELCOME</h1><span>即将进入后台管理系统……</span></div><br /> <div class="logo"></div><br /> <div class="name"><br /> <ul><br /> <li><span>用户名:</span><input name="txtUserName" type="text" id="txtUserName" class="login_input required" /></li><br /> <li><span>密 码:</span><input name="txtUserPwd" type="password" id="txtUserPwd" class="login_input required" /></li><br /> <li class="yzm"><span>验证码:</span><input name="txtCode" type="text" maxlength="6" id="txtCode" class="login_input required" /><br /> <br /> <img src="/Thinkphp/momuadmin.php/Public/code" alt="点击切换验证码" title="点击切换验证码" style="max-width:90%"onclick="ToggleCode(this, '/Thinkphp/momuadmin.php/Public/code');<br /> return false;" /><br /> </li><br /> </ul><br /> <div class="ok"><br /> <input type="submit" name="btnSubmit" value="登 录" id="btnSubmit" class="login_btn" /><br/><br /> </div><br/><br /> </div><br /> </div><br /> </div><br /> <div class="footer"><br /> <div class="footbox">Copyright 1998 - 2013 MOMU. All Rights Reserved. <a href="#target="_blank" style="color:#FFF;"</a> 版权所有</div><br /> </div><br /> </div><br /> </form><br />
<br /> public function do_login() {<br /> $username = $_POST['txtUserName'];<br /> $userpwd = $_POST['txtUserPwd'];<br /> $code = $_POST['txtCode'];<br /> if ($code==$_SESSION['verify']) {<br /> $m = M('Manger');<br /> $where['username'] = $username;<br /> $where['userpwd'] = md5($userpwd);<br /> $i = $m->where($where)->count();<br /> if ($i > 0) {<br /> $this->redirect(__URL__ / main);<br /> } else {<br /> $this->error('用户名或密码错误');<br /> }<br /> } else {<br /> var_dump($_POST).'</br>';<br /> //var_dump($_SESSION['verify']);<br /> //$this->error('验证码错误');<br /> }<br /> }<br /><br />
<div class="footbox">Copyright 1998 - 2013 MOMU. All Rights Reserved. <a href="#target="_blank" style="color:#FFF;"</a> 版权所有</div>
<div class="footbox">Copyright 1998 - 2013 MOMU. All Rights Reserved. <a href="#" target="_blank" style="color:#FFF;"></a> 版权所有</div>
<br /><?php<br />$username = $_POST['txtUserName'];<br />$userpwd = $_POST['txtUserPwd'];<br />$code = $_POST['txtCode'];<br /><br />echo $username;<br />echo $userpwd;<br />echo $code;<br />?><br />