Reputation: 122
i have a form with multiple inputs with the same name as the following:
.... 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 ....
I need to mention that the inputs giving me the error are the listed above and they are not being validated.
the error is as follows:
htmlspecialchars() expects parameter 1 to be string, array given
Upvotes: 0
Views: 53
Reputation: 131
Inputs that their name contains []
at the end send an array to the server.
You may not pass an array to htmlspecialchars(), as it excepts string.
Upvotes: 1