ID: 33661 Updated by: [EMAIL PROTECTED] Reported By: f dot hardy at origami-systems dot com -Status: Open +Status: Feedback Bug Type: HTTP related Operating System: freebsd 4.10 PHP Version: 5.0.4 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2005-07-12 16:16:17] f dot hardy at origami-systems dot com I am using firefox 1.0.4 on freebsd. Response Headers - http://xxx.local/update.php Date: Tue, 12 Jul 2005 14:14:53 GMT Server: Apache/1.3.33 (Unix) PHP/5.0.4 X-Powered-By: PHP/5.0.4 Keep-Alive: timeout=15, max=96 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html 200 OK ------------------------------------------------------------------------ [2005-07-12 16:12:38] [EMAIL PROTECTED] You don't need an action there. But if you set it explicitly it doesn't change the result. ------------------------------------------------------------------------ [2005-07-12 16:04:00] [EMAIL PROTECTED] Whats happend after you add the missing action tag ot the form? ------------------------------------------------------------------------ [2005-07-12 16:03:36] [EMAIL PROTECTED] Are you sure? I tested your code under both PHP 4.4 and 5.1 and it works nicely. With a request like: POST /abc.php HTTP/1.1 Host: localhost User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: UTF-8,* Keep-Alive: 300 Connection: keep-alive Referer: http://localhost/abc.php Content-Type: application/x-www-form-urlencoded Content-Length: 19 test=&modify=Modify I get back: HTTP/1.x 404 Not Found Date: Tue, 12 Jul 2005 13:59:21 GMT Server: Apache/1.3.33 (Debian GNU/Linux) PHP/5.1.0-dev X-Powered-By: PHP/5.1.0-dev Content-Type: text/html; charset=utf-8 Keep-Alive: timeout=1, max=100 Connection: Keep-Alive Transfer-Encoding: chunked Of course, there is no body to the 404 response, because you are not sending any. So how exactly did you check that you were getting a 200 back on the POST request? ------------------------------------------------------------------------ [2005-07-12 15:33:03] f dot hardy at origami-systems dot com Description: ------------ I have a problem with $_POST and the header() function. If I make a test on $_POST, my 404 http header is replaced by a 2OO OK header. If I make a test on $_GET (with a get action in html form), or an another variable, I receive the 404 http header. Reproduce code: --------------- <?php if (isset($_POST['test']) == true) { header("HTTP/1.1 404 Not Found", true); die(); } else { ?> <form method="post"> <input type="text" name="test" value="" /> <input type="submit" name="modify" value="Modify" /> </form> <?php } ?> Expected result: ---------------- A 404 HTTP header in response. Actual result: -------------- A 200 OK HTTP header in response. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33661&edit=1
