我有以下检查框结构
<input type="checkbox" name="reg_field['first_name']" value="1" /> First Name<br />
<input type="checkbox" name="reg_field['last_name']" value="1" /> Last Name<br />
<input type="checkbox" name="reg_field['paypal_email']" value="1"/> PayPal Email<br />
<input type="checkbox" name="reg_field['website_url']" value="1" /> Website URL<br />
<input type="checkbox" name="reg_field['address']" value="1"/> Address<br />
对于某些安装,我可以访问这些字段
$reg_new_values = (isset($_POST['reg_field'])?$_POST['reg_field']:array());
echo $reg_new_values["'first_name'"]
但是对于某些安装,它根本不起作用?
我的结构是错误的,还是我必须在PHP.INI中更改一些设置
答案 0 :(得分:0)
将名称更改为此reg_field[first_name]
而非reg_field['first_name']
。删除单引号,通过这样做,您可以访问每个字段名称:
$FirstName = $_POST['reg_field']['first_name'];