There is obviosly somethign wron with the $_SESSION code in both the error message code and in the code which calls it; php code 1 and 3 in above post.
VBut can anyone spot what the problem is - why isnt it calling the error message.
Header Problem
Moderator: General Moderators
So with regards to displaying the error message are you saying
this needs to be at the top of the homepage with no spaces. For the error message to show??
Code: Select all
<?
if(isset($_SESSION['errmsg'])){
echo $_SESSION['errmsg'];
unset($_SESSION['errmsg']);
}
?>Volka im really sorry but ive read your post over and over again. I dont understand.
Lets keep it simple.
What should I change on this code to make the error message appear.
The code listed above works fine it throws the unauthorized user back to the homepage it just doesnt show them the error message.
What should I change to make this error message appear?
Lets keep it simple.
What should I change on this code to make the error message appear.
The code listed above works fine it throws the unauthorized user back to the homepage it just doesnt show them the error message.
What should I change to make this error message appear?
Do you know for sure the session is working properly? Maybe you need to start the session on each page (ie - the one that is creating the session and the one that is detecting if it has been set).
See here to find out more:
http://uk2.php.net/function.session-start
(i'm afraid i can't try your code out as i don't have access to php localhost right now)
See here to find out more:
http://uk2.php.net/function.session-start
(i'm afraid i can't try your code out as i don't have access to php localhost right now)
as simple as it getsmohson wrote:Lets keep it simple.
Code: Select all
<?php
echo 'xyz';
session_start(); // won't work, output before session_start(), warning: cannot modifiy yadda yadda
?>Code: Select all
<?php
session_start(); // session_start before any output for this htttp-request, no problem.
echo 'xyz';
?>mohson wrote:headers already sent by (output started at /export/TSG-Z/web-source/organisation/plCMS/organisation:2 in export/TSG-Z websource/organisation/PL/CMS/Uorgs.htm on line 6.