PHP Classes

Help Me

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  Help Me  
Subject:Help Me
Summary:I have a problem with alerting a message stored in a session var
Messages:2
Author:harish
Date:2011-03-30 07:00:41
Update:2011-03-31 15:54:32
 

  1. Help Me   Reply   Report abuse  
Picture of harish harish - 2011-03-30 07:52:55
if(isset($_SESSION['msg'])&& !empty($_SESSION['msg'])){
echo '<script type="text/javascript">alert("'.$msg.'")</script>';
unset($_SESSION['msg']);
}

I have this code used in the index file. The problem is that the message whatever stored in session is not alerted even the first time page loads after the session variable is declared. If i comment the third line then it works, but i need to unset the session variable after it is alerted. Help me what may be the possible caused for the problem.

Thanks
Harish

There is 1 reply in this thread, which is not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.