Php 将数据传递到确认页会导致未定义变量错误
我有一个问题,我有一个调查,在这个问题是一个单选按钮组与其他选择,有一个文本输入其他Php 将数据传递到确认页会导致未定义变量错误,php,Php,我有一个问题,我有一个调查,在这个问题是一个单选按钮组与其他选择,有一个文本输入其他 <h3>* What is the primary job position of the individual assigned to this particular test?</h3> <input type="radio" name="job" value="Baker">Baker <input
<h3>* What is the primary job position of the individual assigned to
this particular test?</h3>
<input type="radio" name="job" value="Baker">Baker
<input type="radio" name="job" value="IT">IT<br>
<input type="radio" name="job" value="CEO">CEO
<input type="radio" name="job" value="Flunkey">Flunkey<br>
<input type="radio" name="job" value="other">Other
<input type="text" name="otherJob" >
我将数据传递到提交页面
<input type="hidden" name="job" value="<?php echo $job?>">
<input type="hidden" name="other" value="<?php echo $otherjob?>">
您的一个变量用小写字母表示“j”,另一个变量用大写字母表示
- PHP中的变量名区分大小写李>
$otherjob
和$otherjob
的处理方式不同,它们不是同一个变量
为了绝对确定,您还应该确保您的代码包含
标记并使用POST方法
- 在你发帖的时候,你的问题中没有显示
添加到文件的顶部,这将有助于查找错误
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
// rest of your code
您的表单标签如何;使用any?他确实有一个表单标签,并且已经发布了表单-否则他在尝试访问$\u POST内容时会得到一个“未定义的索引”。是的,但我只是想绝对确保。是的,它包含在表单标签之间。对不起,我遗漏了
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
// rest of your code