Home > Backend Development > PHP Tutorial > CI框架,表述提交没有反应,这是为什么呢

CI框架,表述提交没有反应,这是为什么呢

WBOY
Release: 2016-06-13 11:18:24
Original
908 people have browsed it

CI框架,表达提交没有反应,这是为什么呢
这是view里的表单的代码块

<br /><form class="login active" action="http://localhost/~chrisfu/CI/index.php/login/checklogin" method="post"><br />						<h3>Login</h3><br />						<div><br />							<label>Username:</label><br />							<input type="text" name="name"/><br />							<span class="error">This is an error</span><br />						</div><br />						<div><br />							<label>Password: <a href="forgot_password.php" rel="forgot_password" class="forgot linkform">Forgot your password?</a></label><br />							<input type="password" name="psword"/><br />							<span class="error">This is an error</span><br />						</div><br />						<div class="bottom" ><br />							<div class="remember"><input type="checkbox" /><span>Keep me logged in</span></div><br />							<input type="submit" value="Login" name="submit"></input><br />							<a href="register.php" rel="register" class="linkform">You don't have an account yet? Register here</a><br />							<div class="clear"></div><br />						</div><br />					</form><br />
Copy after login



这是php代码
<br /><?php<br />class Login extends CI_Controller{<br />	function index(){<br />		$this->load->view('index');<br />	}<br />	function checklogin(){<br />		$this->load->model('test_m');<br />		$user=$this->test_m->user_select($_POST['name']);<br />		<br />		if($user){<br />			if($user[0]->upass==$_POST['pword']){<br />				echo "password right";<br />				$this->load->library('session');<br />				$arr=array('uid'=>$user[0]->uid);<br />				$this->session->set_userdata($arr);<br />				echo "<br>";<br />				echo $this->session->userdata('uid');<br />			}else{<br />					echo "password wrong";<br />			}<br />		}else{<br />			echo "user not exist";<br />		}<br />	}<br />}<br />	<br />?><br />
Copy after login

php h?t?m?l CI
------解决方案--------------------
换下提交按钮的名字试下,用firebug监视一下网络
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template