为什么视图传值到控制器为空
视图代码:<body>
<table border=1 width=60% align="center">
<tr>
<td align="center"><h1>CI简单新闻系统</h1></td>
</tr>
</table>
</br>
<table border=1 width=60% align="center">
<tr>
<td align="center" width=10%>
<form action="http://localhost/CI/admin" method="post">
<table border="1" width="100%">
<tr>
<td>用户名:</td><td><input type="text"id="user"/></td>
</tr>
<tr>
<td>密码:</td><td><input type="password" id="pwd"/></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="登录" id="sub"/></td>
</tr>
</table>
</form>
</td>
<td align="center" width=50%></td>
</tr>
</table>
</body>
codeigniter/admin.php 中获取$_POST数组为空,求教大大 codeigniter/admin.php :
echo $_POST['user'];
echo $_POST['pwd'];
出现:A PHP Error was encountered
Severity: Notice
Message: Undefined index: user
Filename: controllers/admin.php
Line Number: 3
A PHP Error was encountered
Severity: Notice
Message: Undefined index: pwd
Filename: controllers/admin.php
Line Number: 4
无法获取值,求指教 解决了 使用name传值 不是用id 感谢各位 结贴 你沒有給input name名字. 楼主牛逼啊。
页:
[1]