I have a panel.php in which I load my different pages by the include method. As there is a single panel, the message display system must be included here, and there will not always an error id to be displayed.
I have added the following code to my panel, calling function "envioMensaje" in case there is getting any variable 'msg':
<?php
if ($_GET) {
if ($_GET['msg']) {
$id_mensaje=$_GET['msg'];
$mensaje=envioMensaje($id_mensaje);
echo $mensaje;
}
}
?>
This works fine when a message id is sent, but when not I get a "Undefined index: msg in..." error. I have tried also:
if ($_GET) {
if ($_GET['msg']) {
$id_mensaje=$_GET['msg'];
$mensaje=envioMensaje($id_mensaje);
echo $mensaje;
} else {
echo"";
}
}
And some other variations with no result. Why is it always looking for 'msg'? Could it be because on that same document I have this other conditional asking for $_GET? (i need it for the content to be loaded):
if (!$_GET) {
include('config/shortcuts.php');
} else {
$directorio = $_GET['directory'];
include('config/'.$directorio);
}