PHP 4.0 Bug #6481 Updated: Gzcompress

From: Date: Mon, 04 Sep 2000 07:33:49 +0000
Subject: PHP 4.0 Bug #6481 Updated: Gzcompress
Groups: php.dev 
Request: Send a blank email to php-dev+get-31898@lists.php.net to get a copy of this message
ID: 6481 User Update by: wico@cnh.nl Old-Status: Closed Status: Open Bug Type: Misbehaving function Description: Gzcompress Hiya As i allready said in my email thats a typo. This works: function Compress ($data) { $fp = fopen("/tmp/tempje", "w"); fputs($fp, $data); fclose($fp); $data2 = cat /tmp/tempje |/usr/bin/gzip -f; Header("Content-Type: text/html"); Header("Content-Encoding: gzip"); echo($data2); } this doesn't: function Compress ($data) { $data = gzcompress($data); Header("Content-Type: text/html"); Header("Content-Encoding: gzip"); echo($data); } Previous Comments: [2000-09-03 06:02:23] stas@php.net That's easy - you don't define data2 in second function. --------------------------------------------------------------------------- [2000-09-01 11:07:03] wico@cnh.nl Hiya I want to compress webpages for clients that support it $data is a whole html page but: This works: function Compress ($data) { $fp = fopen("/tmp/tempje", "w"); fputs($fp, $data); fclose($fp); $data2 = cat /tmp/tempje |/usr/bin/gzip -f; */ Header("Content-Type: text/html"); Header("Content-Encoding: gzip"); echo($data2); } this doesn't: function Compress ($data) { $data = gzcompress($data); Header("Content-Type: text/html"); Header("Content-Encoding: gzip"); echo($data2); } Anyone can explain this? Greetz, Wico --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=6481

« previous php.dev (#31898) next »