kee2ka4 Posted November 19, 2008 Share Posted November 19, 2008 Hey peeps, I have a question as why Internet explorer never displays my error messages the frist time I run my code and always displays it the second time. I am using $_SESSION['flash']['warning'] to displays messages. Here is the breakdown of my code. I am using the function below to display error messages: function flash_warning($msg) { if(!$msg) { return false; } $_SESSION['flash']['warning'] = $msg; return true; } In my controller file I have the following code that simply decides if the condition in false then display the message. if(!formSent($params)) {flash_warning("Sorry your message cannot be sent");} In the view file, I display the error mesage(if there is any) using a simple if statement: <?php if($_SESSION['flash']['warning']) { ?> <span class="helpMsg"><?php echo $_SESSION['flash']['warning']; ?></span> The above code works fine the with Firefox but with Internet Explorer it never displays the error message the frist time and always displays it the second time. Can anyone please guide me why this happens? Thanks, Zub Link to comment https://forums.phpfreaks.com/topic/133318-solved-i-am-using-_sessionflashwarning-to-display-error-msg-and-need-some-help/ Share on other sites More sharing options...
kee2ka4 Posted November 19, 2008 Author Share Posted November 19, 2008 Hi guys, just to update I have sorted out the problem. Bascially it was my htaccess file that was the root of the problem. Link to comment https://forums.phpfreaks.com/topic/133318-solved-i-am-using-_sessionflashwarning-to-display-error-msg-and-need-some-help/#findComment-693382 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.