[英]Form data not passing to PHP
我有什么应该是将数据传递到php页面的简单形式。 形式是:
<form action="php/setlist.php" method="post">
<input type="text" id="SetListName" />
<input type="hidden" id="newList" name="newList" value="" readonly="readonly" style="border: none;">
<input type="submit" style="width:150px;"><br /><br />
和PHP是:
$SetListSave = $_REQUEST['newList'];
$SetListName= $_REQUEST['SetListName'];
echo $SetListName;
echo $SetListSave;
我从窗体中获取newList很好,但是没有传递SetListName。 我是php的新手,所以我在这里可能会缺少一些基本的知识,但是我很困惑。
您在以下位置缺少name
属性:
<input type="text" id="SetListName" />
更换
<input type="text" id="SetListName" />
同
<input type="text" id="SetListName" name ="SetListName"/>
对于要在PHP中读取的每个输入字段,您都需要在表单中具有“名称”属性。 因此,您的代码应为:
<form action="php/setlist.php" method="post">
<input type="text" id="SetListName" name="SetListName"/>
<input type="hidden" id="newList" name="newList" value="" readonly="readonly" style="border: none;">
<input type="submit" style="width:150px;"><br /><br />
采用
<input type="text" id="SetListName" name="SetListName" />
您尚未使用name
属性
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.