$_GET is a glob var. which is triger/created when you’re sending html form data og visit a link. When is send from form you can add the needet info in “action” atr. But from youre example i see onlu that you return from the function some string…did not see the part of adding it to the $_GET…
as sugested up you can use $_REQUEST[“GET”] or $_SERVER[‘REQUEST_METHOD’] allso
lets roll back a sec. – you need to add some extra data to the get requst if have some specific condition ( ‘error )and the what??? for example :
This directly will add data to url and redirect to da location, do proper escaping..this is example
function get_server_info(){
$server = array();
if(isset($_SERVER['REMOTE_ADDR'])){
$server["ip"] = $_SERVER['REMOTE_ADDR'];
}else{ $server["ip"] = false; }
if(isset($_SERVER['HTTP_HOST'])){
$server["host"] = $_SERVER['HTTP_HOST'];
}else{ $server["host"] = false; }
if(isset($_SERVER['QUERY_STRING'])){
$server["query"] = $_SERVER['QUERY_STRING'];
}else{ $server["query"] = false; }
if(isset($_SERVER['HTTP_REFERER'])){
$server["from"] = $_SERVER['HTTP_REFERER'];
}else{ $server["from"] = false; }
if(isset($_SERVER["REQUEST_URI"])){
$server["requested"] = $_SERVER["REQUEST_URI"];
}else{ $server["requested"] = false; }
return $server;
}
function redirect_to($location,$content = “text/html”){
header("Location: ".$location);
header("Content-Type: ".$content);
exit;
}
this should redirect you to the original intendet location whit extra url data
somthing like this
function add_to_url(){
$server = get_server_info();
if( youre condition ){
$to_add ='<div id="login_error">El usuario o contraseña no es correcto.
</div>';
$redirect_to = $server["requested"]."&".$to_add;
redirect_to( $redirect_to);
}
}