使用HTML表单中的PHP文件中获取错误未定义的数组键
我有将数据从HTML列表发送到PHP文件的问题。这是我的代码:
` <form method="post" action="file.php">
field: <select type="text" name="name" >
<option value=”1” >No1 </option>
<option value=”2” > No2</option>
<option value=”3” >No3 </option>
</select>
<input type="submit" value="submit">
</form>
这是PHP文件中接收值的代码:
$var = $_POST["name"];
echo $var;
但是我会遇到错误获取错误未定义的数组键“名称”。 如果有人可以帮助我解决这个问题,那将是感谢的。
I've got issues with sending data from a html list to a php file. here is my code:
` <form method="post" action="file.php">
field: <select type="text" name="name" >
<option value=”1” >No1 </option>
<option value=”2” > No2</option>
<option value=”3” >No3 </option>
</select>
<input type="submit" value="submit">
</form>
and this is code in php file which receives the value:
$var = $_POST["name"];
echo $var;
but I'm getting error getting error Undefined array key "name".
would be thankful if anybody could help me with this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
而是使用此:
Use this instead: