3
Good afternoon I have a doubt this command is correct?
http://localhost/site/index.php#contato?info=Email%20Vazio
index.php#contact? info=Email%20Vazio
This is the function that sends the command but the page is at the top and the message no longer appears in the form.
private function setNome($nome){
if(!empty($nome)){
$validar = new Validar($nome);
$this->nome = $validar->getValidado();
}else{
$this->setError("Nome Vazio");
return print "<script language='JavaScript'>location.href='"
. "index.php#contato?info={$this->getError()}'</script>";
exit();
}
Should I withdraw the #contato
, works but I’d like it to go straight to the form so that the user doesn’t have to scroll down the entire page again at each typing error
It’s the opposite: first comes the query and then Fragment; see the format in this question: https://answall.com/q/228220/64969
– Jefferson Quesado
The #contact anchor should come after the parameters. Test like this:
http://localhost/site/index.php?info=Email%20Vazio#contato
– Sam
worked out thanks
– Adriano Back