FRAMIREZS
Posts: 6
|
| Posted: 08/30/2005, 2:24 AM |
|
I want to redirect to login page if a user types in the browser another application page. I know if user is login by session variable.
I put in before show event page this code
$ID=CCGetSession("UserID,0);
if ($ID==0) $Redirect="login.php";
But this error appears
Warning: Cannot modify header information - headers already sent by (output started at /opt/caliges/menu_events.php:75) in /opt/caliges/menu_events.php on line 28
I tried with header("Location: login.php");
Any idea,
Thanks
|
 |
 |
mrachow
Posts: 509
|
| Posted: 08/30/2005, 7:10 AM |
|
Try
CCGetSession("UserID");
"only".
_________________
Best regards,
Michael |
 |
 |
mrachow
Posts: 509
|
| Posted: 08/30/2005, 7:11 AM |
|
E.g. look for the second apostrophe.
_________________
Best regards,
Michael |
 |
 |
DonB
|
| Posted: 08/30/2005, 7:45 AM |
|
I suspect an error message was output, prior to the 'real' header or the
page being sent, which is what it's trying to tell you with "can't modify
header" and "already sent".
As to why that is, it's that (as mrachow indicates) there appears to be a
missing quotation mark before the comma in your CCGetSession function call.
If you put
exit;
on the next line following the 'if' statement, you'll probably be able to
see the error message. I'm fairly sure it's being 'gobbled up' by the
redirect, meaning it's sent to the browser but you don't have a chance to
see it.
--
DonB
http://www.gotodon.com/ccbth
"FRAMIREZS" <FRAMIREZS@forum.codecharge> wrote in message
news:5431425d4a277d@news.codecharge.com...
> I want to redirect to login page if a user types in the browser another
> application page. I know if user is login by session variable.
>
> I put in before show event page this code
>
> $ID=CCGetSession("UserID,0);
> if ($ID==0) $Redirect="login.php";
>
> But this error appears
>
> Warning: Cannot modify header information - headers already sent by
(output
> started at /opt/caliges/menu_events.php:75) in
/opt/caliges/menu_events.php on
> line 28
>
> I tried with header("Location: login.php");
>
> Any idea,
>
> Thanks
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|