|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-08-24 18:03 UTC] ericp at amazon dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 10 10:00:01 2025 UTC |
Description: ------------ If I include a serialized variable in header() it produces an entirely different result than if I just print() the result... I've also tested: 4.3.3, 5.0.0 and of course 5.0.1 and its reproducable in both scenario Make sure you POST the form to get the variable back :) even a strlen($s) will produce different results...its weird. Thanks, Eric Reproduce code: --------------- <?php function jpcache_debug2($s) { header("X-CacheDebug-five: $s"); print $s; } $myVariable = serialize($_POST); jpcache_debug2($myVariable); ?> <html><body> <form method="POST" action="test-error.php"> <input type="hidden" name="foo" value="bar"> <input type="submit" value="blah"> </form> </body> </html>bash-2.05$ Expected result: ---------------- Response Headers Date: Tue, 24 Aug 2004 14:49:52 GMT Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) PHP/5.0.1 mod_ssl/2.8.12 OpenSSL/0.9.6b X-Powered-By: PHP/5.0.1 X-CacheDebug-five: a:1:{s:3:"foo";s:3:"bar";} Connection: close Transfer-Encoding: chunked Content-Type: text/html a:1:{s:3:"foo";s:3:"bar";} <html> <body> <form method="POST" action="test-error.php"> <input type="hidden" name="foo" value="bar"> <input type="submit" value="blah"> </form> </body> </html> Actual result: -------------- Response Headers Date: Tue, 24 Aug 2004 14:49:52 GMT Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) PHP/5.0.1 mod_ssl/2.8.12 OpenSSL/0.9.6b X-Powered-By: PHP/5.0.1 X-CacheDebug-five: a:0:{} <--- WHAT?!? Connection: close Transfer-Encoding: chunked Content-Type: text/html a:1:{s:3:"foo";s:3:"bar";} <html> <body> <form method="POST" action="test-error.php"> <input type="hidden" name="foo" value="bar"> <input type="submit" value="blah"> </form> </body> </html>