I want to show the user after login when the last backup was made.
I have the date but i cannot get the message to show after successfull login.

Nothing happens. No error just no message

The code i use is in the after successfull login event :


                $DagenGroteKasControle="SELECT `Datum` FROM `grotekascontrole` WHERE `Afdeling` = ".$data['Afdeling']." ORDER BY `GKCID` DESC Limit 1";
                $Dagen
=CustomQuery($DagenGroteKasControle);
               
while ($resultdagen=db_fetch_array($Dagen))
               
{
                $now
= Now();
                $Datum
=$resultdagen["Datum"];
                $datediff
= $now - $Datum;
               
}

               
//**********  Display a message on the Web page  ************
                echo
"Number of day since last backup : ".$datediff;

You cannot display anything in AfterSuccessfulLogin event because after login user is redirected to another page. What you can do is to save your message in session variable and display it later on any other page i.e.

in AfterSuccessfulLogin
$_SESSION["message"]="Number of day since last backup : ".$datediff;
Then on any other page insert PHP code snippet and use something like this:
if ($_SESSION["message"]!="") {
   echo $_SESSION
["message"];
   $_SESSION
["message"]="";
}

Post a Comment