-3
I have a querystring
to work with url
.
set_include_path('application' . PATH_SEPARATOR. get_include_path() );
function getGet( $key ){
return isset( $_GET[ $key ] ) ? $_GET[ $key ] : null;
}
$path = ('application');
$exe = getGet('exe');
if( is_file( ''.$path.'/'.$exe.'.php' ) )
include ''.$path.'/'.$exe.'.php';
else
include ''.$path.'/dash/404.php';
But I’m passing id
for url
, to generate new pages and I have a div
hidden error so.
echo $exibir ? 'block' : 'none';
When I step into the url
the error in this way:
if (!isset($_GET["error"]) == "error") {
$exibir = null;
} else {
$exibir = "block";
//var_dump($nome);
}
So in return I have this:
header('Location: '.$_SERVER['HTTP_REFERER'].'?error=error');
If you make a mistake, go to url
error = error then mine query
stays
?id=teste?error=error
But returns blank the screen and does not display the error message. When I do not pass
the ID
for url
or create a ID
in the link case, it works smoothly but within the query
doesn’t work.
I don’t understand what the problem is. By the way this link is wrong, it should be
?id=teste&error=error
.– Jorge B.
The error is that I already have a query in the url ? id=test where is the ID created when I step ? error=error, getting ? id=test? error=error the screen turns white and does not run the
code
echo $display ? block: 'None';code
– WIRLA DE BARROS CARVALHO
@Jorgeb. is that his IF is wrong:
!isset($_GET["error"]) == "error"
, is comparing a boolean to== "error"
. "Typo"– Guilherme Nascimento