Thread View: adobe.golive.dynamic.content
4 messages
4 total messages
Started by Jeremy_M._Cox
Tue, 17 Aug 2004 16:19
Ignoring PHP before headers
Author: Jeremy_M._Cox
Date: Tue, 17 Aug 2004 16:19
Date: Tue, 17 Aug 2004 16:19
13 lines
1666 bytes
1666 bytes
I have used a session check type function in another site where if certain session variables aren't registered then it includes a login page. It worked like a charm.
I copied and pasted the code over and changed the names of the session variables and the path to the include file but every time I run the page in the browser the session check function gets ignored totally. I even entered a bad path in the include statement. Still gets ignored.
So I put the funciton in an include file and the include code in the page got ingnored then too.
What is going on?
PS Session check looks like this:
// <?php function session_checker(){ if(!session_is_registered('xtra_first') && !session_is_registered('xtra_password') && // !session_is_registered('xtra_clearance') && !session_is_registered('xtra_ID')) { // include '../../path_to_login_form'; // exit(); // } // } // ?>
// <?php session_start(); ?>
// <?php session_checker(); ?>
Re: Ignoring PHP before headers
Author: Jerry_Artman
Date: Wed, 18 Aug 2004 18:15
Date: Wed, 18 Aug 2004 18:15
1 lines
661 bytes
661 bytes
Have you tried using the superglobals?
Re: Ignoring PHP before headers
Author: Jeremy_M._Cox
Date: Mon, 23 Aug 2004 05:09
Date: Mon, 23 Aug 2004 05:09
3 lines
983 bytes
983 bytes
Ok Jerry, I might have put my finger on the problem. I copied the code from a simple text file and apparently it also pasted in some hidden characters (i.e. tabs, returns) Seems like if I retyped the code myself and but in the tabs and returns myself right in source mode it starts to work. Any truth to this assumption.
Re: Ignoring PHP before headers
Author: Jerry_Artman
Date: Mon, 23 Aug 2004 11:39
Date: Mon, 23 Aug 2004 11:39
3 lines
913 bytes
913 bytes
Could be since tabs and new-lines etc are supposed to be markup elements. This would force the PHP runtime to treat the items as HTML rather than code by un-linking the php enclosure tags themselves. However, if it was 'simpletext' it wouldn't have those. Could you 'show invisibles' like in BBEDIT?
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads