Re: More on Auth problem
| From: | Alexander Payne | Date: | Wed, 10 Mar 2004 12:58:59 +0000 |
| Subject: | Re: More on Auth problem | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11200@lists.php.net to get a copy of this message | ||
Thanks very much for your reply. I will look into output buffering; I think I can accomplish what I desire with that technique.
However, I find it very odd that the PEAR developers would create a function that effectively requires you to send an HTML form before the opening HTML tag of your site, unless I am misunderstanding something. Calling auth->start() at the top of my script draws the login form, then sends the rest of the page's HTML. Most browsers can render this, of course, but having HTML elements that should be in the BODY tag at the top of the file is seriously malformed.
Am I incorrect in the method by which I am calling auth->start()? Is there some way to get Auth to generate a cookie first and draw its login box later?
Thanks again.
On Mar 10, 2004, at 5:38 AM, Herman Sinte Maartensdijk wrote:
Creating Cookies must be doen before any output has been send. If you really can not move your authentictaion to the top of the script (or at least before any output has been send) have a look at output buffering http://nl.php.net/manual/en/function.ob-start.php Herman -----Original Message----- From: Alexander Payne [mailto:apayne1@umbc.edu] Sent: Tuesday, March 09, 2004 23:57 To: pear-general@lists.php.net Subject: [PEAR] More on Auth problem I have done some more debugging and the issue appears to be that the call to auth->start() in my main site is not producing a cookie. I have set up a couple of stripped-down test pages with nothing more than Auth calls and a test line of text and these generate a cookie just fine. I have also tried moving the call to auth->start() to the top of my main site's script and this works. Placing the call later in the script, after the HTML headers for example, seems to prevent it from generating a cookie. Would a JavaScript include or something similar interfere? ________________________________________________Alexander Payne