headers & passthru()

From: Date: Thu, 05 Apr 2001 03:59:05 +0000
Subject: headers & passthru()
Groups: php.general 
Request: Send a blank email to php-general+get-47168@lists.php.net to get a copy of this message
Hi, i got this problem, when I use an executable to produce the output for the html php sends headers screwing it all. For example, my script is like this: <? ..... some stuff in php using database to prepare tempfile .... .... passthru("cat $tempfile | /usr/local/bin/somecgi"); unlink($tempfile); exit; ?> in this example PHP does not generate HTML code, but the problem is it still sends header "Content-type: text/html". Why? I really dont need this , because my "somecgi" script produces its own headers and actualy it is redirecting. So, this "content-type: text/html" that php generates is really screwing it all and redirect is failing. How can I disable php printing headers at all? I am sure no HTML nor headers are printed during php execution before "passthru" command. To make sure I placed a call to headers_sent() before passthru() and it returned false, after passthru() it returns true. Any ideas what to do? Thanks a lot nikolai

« previous php.general (#47168) next »