Re: php via cmdline including unwanted headers
| From: | Zoltán Németh | Date: | Wed, 30 May 2007 07:21:08 +0000 |
| Subject: | Re: php via cmdline including unwanted headers | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-255782@lists.php.net to get a copy of this message | ||
2007. 05. 30, szerda keltezéssel 02.11-kor Sebe ezt írta:
> I run some scripts via php (cgi) which sends output to another file, but
> it's including unwanted cookie header, etc in the outfile.
>
> example:
>
> php /home/dev/script.php > /home/production/feeds/news.xml 2>&1
>
> and at the top of news.xml i get:
>
> X-Powered-By: PHP/5.2.2
> Set-Cookie: .....
> Set-Cookie: .....
> Cache-Control: private
> Content-Type: text/html; charset=ISO-8859-1
>
> i turned off expose php which gets rid of the x-powered-by but what
> about the rest?
>
what if you just simply replace all echo-s with fwrite calls in the
script (of course with an fopen at the beginning and an fclose at the
end). you could pass the filename as a parameter into $argv
greets
Zoltán Németh