Re: Headers and sessions in php .cgi
| From: | B�rge Strand | Date: | Sat, 10 Jan 2004 19:42:17 +0000 |
| Subject: | Re: Headers and sessions in php .cgi | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-174214@lists.php.net to get a copy of this message | ||
> > I have a problem setting my headers right with php running as
> > .cgi. I have to specify a Content-type for the cgi file to work.
> > But how should I do both that and start a session?
>
> Try using header() instead of print to set Content-Type.
>
> Hope that helps.
Thanks Chris. I tried that (see original post). Then I get a 500 error
in my browser and bad header in error_log.
Guess I'll have to take session_start() apart and see what it does.
This all worked in 4.2, though, where I used .cgi files without a
die-hard need for Content-type.
As I said in a previous post, everything works when I run my program
as a .php file without Content-type. So I guess there's a conflict
between the Content-type header and those inserted by session_start()
in 4.3.4.
Thanks for any help, I'm on a bad deadline and my ISP changed PHP
version without telling!
--
Børge