【问题标题】:Validate inputs with the same name recieved htmlspecialchars() error raised验证收到的具有相同名称的输入 htmlspecialchars() 引发错误
【发布时间】:2021-10-09 10:23:11
【问题描述】:

我有一个包含多个输入的表单,其名称如下:

.... 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() 期望参数 1 是字符串,给定数组

【问题讨论】:

标签: php html laravel validation


【解决方案1】:

输入他们的名字在结尾包含 [],发送和数组到服务器。 您不能将数组传递给 htmlspecialchars(),因为它不包括字符串。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-05-06
    • 2022-01-09
    • 1970-01-01
    • 1970-01-01
    • 2019-05-08
    • 1970-01-01
    • 2017-10-16
    相关资源
    最近更新 更多