this might be a stupid question but I'm stuck here at this silly problem for the part 2 hours.
I have this function which checks if a particular config file's variable are not empty. Here's the function :-
include 'inc.config.php';
function not_valid_settings()
{
if((empty($_GLOBAL['id'])) || (empty($_GLOBAL['username'])) || empty($_GLOBAL['password']))
{
return true;
}
else
{
return false;
}
}
Here's the config inc.config.php file:
$_GLOBAL=array();
$_GLOBAL['id'] = "asas";
$_GLOBAL['username'] = "asas";
$_GLOBAL['password'] = 'as';
Function Calling
include 'inc/inc.functions.php';
if(not_valid_settings())
{
echo "Please enter correct entries in inc/inc.config.php";
exit();
}
For some reason, I always get the Please enter correct details. Even if my $_GLOBAL['username']='';
.
What wrong am I doing here?