I'm having a weird issue with a form, if a send any spanish character (á, é, í, ñ, etc...) in the form, it appears as a blank string in the $_POST array.
This is the form:
<form action="<?php echo site_url("home/register"); ?>" method="post">
<div class="row">
<div class="col-md-4 col-md-offset-4">
<input type="text" placeholder="Nombre" name="user[name]" class="form-control"/>
</div>
<div class="space"></div>
<div class="col-md-4 col-md-offset-4">
<input type="text" placeholder="Apellido" name="user[lastname]" class="form-control"/>
</div>
<div class="space"></div>
<div class="col-md-4 col-md-offset-4">
<input type="text" placeholder="E-Mail" name="user[email]" class="form-control"/>
</div>
<div class="space"></div>
<div class="col-md-4 col-md-offset-4">
<input type="password" placeholder="Clave" name="user[password]" class="form-control"/>
</div>
<div class="space"></div>
<div class="col-md-4 col-md-offset-4">
<input type="password" placeholder="Confirmar Clave" name="user[password_confirmation]" class="form-control"/>
</div>
<div class="space"></div>
<div class="col-md-4 col-md-offset-4 text-center">
<input type="submit" value="Registrar" class="btn btn-primary"/>
</div>
</div>
</form>
I already tried without the "user[]".
I have never had this problem before, i know about the enconding problems but just not sending the value is completely new for me.
I google a lot, but i think i'm making the wrong search because i cant find anything similar.
I'm using PHP 5.5.9, Apache 2.4.7 and using Codeigniter 2, i have worked with this config many times before and, again, never saw this problem before.
Here a test:
If i send the data without spanish characters, there is no problem:
array(1) {
["user"]=>
array(5) {
["name"]=>
string(4) "Jose"
["lastname"]=>
string(5) "Lopez"
["email"]=>
string(7) "t@t.com"
["password"]=>
string(1) "a"
["password_confirmation"]=>
string(1) "b"
}
}
if i change, for example, Jose with José, i get:
array(1) {
["user"]=>
array(5) {
["name"]=>
string(0) ""
["lastname"]=>
string(5) "Lopez"
["email"]=>
string(7) "t@t.com"
["password"]=>
string(1) "a"
["password_confirmation"]=>
string(1) "b"
}
}