Article View: adobe.golive.dynamic.content
Article #149Ignoring PHP before headers
From: 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(); ?>
Technical Details
Message-ID:
<3bb58362.-1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.cambrium.nl!news.cambrium.nl!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!webxShow Full Headers
Complete Article Headers
X-Google-Thread: 11ffd2,21e0a6b8803b77c7,start X-Google-Attributes: gid11ffd2,public X-Google-Language: ENGLISH,ASCII-7-bit From: Jeremy_M._Cox@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.cambrium.nl!news.cambrium.nl!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.golive.dynamic.content Subject: Ignoring PHP before headers Message-ID: <3bb58362.-1@webx.la2eafNXanI> Date: Tue, 17 Aug 2004 09:19:53 -0700 Lines: 27 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit