0
I am recovering a value from an AJAX request, it works fine but it has a problem. The "+" character is replaced by a blank one
Dell printer (supporting eSF 2.1+)
Stays
Dell printer (supporting eSF 2.1 )
And this is giving "bomb" in the system
var XMLHttp = generateXMLHttp();
XMLHttp.open("get", "classes/getDataPropCom.php?qtd_embarcados=" + qtdUsuarios +"&id=" + id, true);
XMLHttp.onreadystatechange = function () {
if (XMLHttp.readyState == 4){
if (XMLHttp.status == 200) {
}
}
});
jquery takes the value with the right "+" Now the GET rescue from Ajax does not take the "+"
When he gets here.... doesn’t take the "+"
if(isset($_GET['qtd_embarcados']) && isset($_GET['id'])){
$qtd_embarcados = $_GET['qtd_embarcados'];
$id = $_GET['id'];
if($qtd_embarcados != ''){
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
/* special ajax here */
$PropostaComercial->getValue($qtd_embarcados,$id);
}else if(empty($usuarios)){
$PropostaComercial->getValue($qtd_embarcados,$id);
}
else{
$PropostaComercial->getValue($qtd_embarcados,$id);
}
}
}
how I take the values
if($("#ComercialEDEP10 h5").html() != undefined){
id = encodeURIComponent($("#ComercialEDEP10 h5").html());
}
if($("#EducacionalEDEP10 h5").html() != undefined){
id = encodeURIComponent($("#EducacionalEDEP10 h5").html());
}
if($("#ProfissionalEDEP10 h5").html() != undefined){
id = encodeURIComponent($("#ProfissionalEDEP10 h5").html());
}
That text with the
+
comes from the server or goes to the server?– Sergio
It is a database value, which I display on the screen, once displayed on the screen, I take the contents of it, once taken sending via ajax to run on an sql
– gabrielfalieri
But then the problem is when you get it from the server or when you send it back?
– Sergio
Like, I transfer via ajax... in this ajax gets nice, then when php with $_GET[] will get the value that gives the error
– gabrielfalieri