PHP 4.0 Bug #7380 Updated: the function passthru is bad!!!!!!!!

From: Date: Sat, 21 Oct 2000 22:46:00 +0000
Subject: PHP 4.0 Bug #7380 Updated: the function passthru is bad!!!!!!!!
Groups: php.dev 
Request: Send a blank email to php-dev+get-35741@lists.php.net to get a copy of this message
ID: 7380 Updated by: lyric Reported By: jorge@e-nexus.com.mx Status: Feedback Bug Type: Output Control Assigned To: Comments: This might be a dumb question, but you do know that you can't just "cat foo.gif" in the middle of a HTML file and expect it to produce an inline image, right? I've got two ideas: a) unless you change it, the content-type of the results from a php program is "text/html". Try adding Header("Content-type: image/gif"); to the start of your PHP file b) the webserver hasn't got enough permissions to see the graphic? Try copying it to the same place as your php file, and typing "chmod 444 file.gif" to make it world-readable. The following code works perfectly for me: <?php Header("Content-type: image/gif"); passthru("cat a.gif"); ?> I suppose there's a reason you're using "cat foo.gif" rather than readfile()? Previous Comments: --------------------------------------------------------------------------- [2000-10-21 01:41:25] jorge@e-nexus.com.mx the function don't return anything to the browser, the problem is when i run a program that need to open a file contained a spaces for example $cmd="cat /home/test/test file.gif"; passthru($cmd); If you run this script the document is EMPTY I try the follow comands without results $cmd="cat "/home/test/test file.gif""; $cmd="cat /home/test/test file.gif"; Please help me --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7380

« previous php.dev (#35741) next »