CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Redirect problem

Print topic Send  topic

Author Message
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

View profile  Send private message
mrachow


Posts: 509
Posted: 08/30/2005, 7:10 AM

Try
CCGetSession("UserID");
"only".
_________________
Best regards,
Michael
View profile  Send private message
mrachow


Posts: 509
Posted: 08/30/2005, 7:11 AM

E.g. look for the second apostrophe.
_________________
Best regards,
Michael
View profile  Send private message
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/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.