Heim >Backend-Entwicklung >PHP-Tutorial >Cannot modify header information headr函数有关问题,代码很简单
Cannot modify header information headr函数问题,代码很简单
login.php
<br /><html><br /><title><br />登陆界面<br /></title><br /><head><br /><meta http-equiv="content-type" content="text/html;charset=utf-8" /><br /></head><br /><body><br /><form action="loginController.php" method="post"><br /><table><br /><tr><td>用户名:</td><td><input type="text" name="username"/></td></tr><br /><tr><td>密码:</td><td><input type="text" name="password"/></td></tr><br /><tr><td><input type="submit" value="登陆"/><td><input type="reset" name="重新填写"/></td></tr><br /></table><br /></form><br /></body><br /></html><br /><br />loginController.php<br /><html><br /><title><br />验证控制器<br /></title><br /><head><br /><meta http-equiv="content-type" content="text/html;charset=utf-8" /><br /></head><br /><body><br /><?php<br />$username=$_REQUEST['username'];<br />$password=$_REQUEST['password'];<br />if($username=='123'&&$password=='123'){<br /> header("location:Manage.php");<br /> exit();<br />} else{<br /> echo '账号密码有误';<br />}<br />?><br /></body><br /></html><br /><br /><html><br /><title><br />管理界面<br /></title><br /><head><br /><meta http-equiv="content-type" content="text/html;charset=utf-8" /><br /></head><br /><body><br /><h1>欢迎管理员</h1><br /></body><br /></html><br /><br />输入用户名密码123<br />错误提示如下:<br />Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\sqlInjcetion\loginController.php:9) in C:\wamp\www\sqlInjcetion\loginController.php on line 13<br /><br />求解!<br />另外3个php文件都是utf-8编码<br />