Re: header function
| From: | CPT John W. Holmes | Date: | Mon, 10 Mar 2003 21:38:03 +0000 |
| Subject: | Re: header function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139037@lists.php.net to get a copy of this message | ||
Use INCLUDE(), not virtual(). virtual() isn't supposed to be used with PHP
files.
---John Holmes...
----- Original Message -----
From: "Barry Gould" <mailinglists@pennysaverusa.net>
To: <php-general@lists.php.net>
Sent: Monday, March 10, 2003 4:26 PM
Subject: Re: [PHP] header function
> I'm starting to think this is a BUG.
>
> Can anyone else test this and confirm or contradict?
>
> Thanks,
> Barry
>
> At 03:35 PM 3/7/2003, you wrote:
> >I am having a hard time with the header("Location:") function inside an
> >include file with PHP 4.3.1 (Linux, running as a module w/ Apache
1.3.27).
> >
> >At the VERY TOP of my php page, I have:
> ><?php virtual("/include/logincheck.php") ?>
> >
> >logincheck.php contains exactly:
> ><?php
> >// login check
> >if(!isset($_SESSION["agent_id"]))
> >{
> > header("Location:/");
> > header("Connection: close");
> > exit;
> >}
> >?>
> >
> >However, if this "agent_id" is not set, I just get a blank page with html
> >open and close tags.
> >
> >I'm SURE there are no spaces or blank lines before these lines.
> >
> >It works fine if I put the code in the main page instead of using the
> >virtual include.
> >
> >Output buffering is set to 4096 in php.ini.
> >
> >Any suggestions would be appreciated.
> >
> >Thanks,
> >Barry
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>