I have if sentence and would like to put in script
function ($message, $db) when there is error (ELSE is performed and function has value FALSE other TRUE).
Script is the following:
[code=php]
$result = mysql_query($query) or die(“ERROR: ” . mysql_error());
if(mysql_num_rows($result) > 0) # we found a match, so set $_SESSION flag:
{
$_SESSION[‘logged’] = TRUE;
if(isset($_SESSION[‘caller’]))
# if we got here from another page, go there
{
header(“Location: ” . $_SESSION[‘caller’]);
//*IT SHOULD PERFORM FALSE for function $message
}
else
# otherwise go to main page
{
header(“Location: home.php”);
//*IT SHOULD PERFORM FALSE for function $message
}
}
else
# invalid login, so create error message
{
//*IT SHOULD PERFORM TRUE for function $message
}