验证具有相同名称的输入收到 htmlspecialchars() 引发的错误
Validate inputs with the same name recieved htmlspecialchars() error raised
我有一个包含多个同名输入的表单:
.... OTHER INPUTS BIENG VALIDATED ....
<input type="text" id="firstname_conjoint_associe" placeholder="" class="form-control " value="" name="firstname_conjoint_associe[]">
<input type="text" id="lastname_conjoint_associe" placeholder="" class="form-control " value="" name="lastname_conjoint_associe[]">
<input type="text" id="email_conjoint_associe" placeholder="" class="form-control " value="" name="email_conjoint_associe[]">
<input type="text" id="firstname_conjoint_associe" placeholder="" class="form-control " value="" name="firstname_conjoint_associe[]">
<input type="text" id="latname_conjoint_associe" placeholder="" class="form-control " value="" name="lastname_conjoint_associe[]">
<input type="text" id="email_conjoint_associe" placeholder="" class="form-control " value="" name="email_conjoint_associe[]">
.... OTHER INPUTS BIENG VALIDATED ....
我需要说明的是,给出错误的输入是上面列出的,它们没有经过验证。
错误如下:
htmlspecialchars() expects parameter 1 to be string, array given
输入名字最后包含[],发送数组到服务器。
您不能将数组传递给 htmlspecialchars(),因为它不包括字符串。
我有一个包含多个同名输入的表单:
.... OTHER INPUTS BIENG VALIDATED ....
<input type="text" id="firstname_conjoint_associe" placeholder="" class="form-control " value="" name="firstname_conjoint_associe[]">
<input type="text" id="lastname_conjoint_associe" placeholder="" class="form-control " value="" name="lastname_conjoint_associe[]">
<input type="text" id="email_conjoint_associe" placeholder="" class="form-control " value="" name="email_conjoint_associe[]">
<input type="text" id="firstname_conjoint_associe" placeholder="" class="form-control " value="" name="firstname_conjoint_associe[]">
<input type="text" id="latname_conjoint_associe" placeholder="" class="form-control " value="" name="lastname_conjoint_associe[]">
<input type="text" id="email_conjoint_associe" placeholder="" class="form-control " value="" name="email_conjoint_associe[]">
.... OTHER INPUTS BIENG VALIDATED ....
我需要说明的是,给出错误的输入是上面列出的,它们没有经过验证。
错误如下:
htmlspecialchars() expects parameter 1 to be string, array given
输入名字最后包含[],发送数组到服务器。 您不能将数组传递给 htmlspecialchars(),因为它不包括字符串。