ID: 24028
Comment by: sky at abcnts dot com
Reported By: xiongwei at aerafront dot com
Status: Feedback
Bug Type: Output Control
Operating System: win32
PHP Version: 4.3.2
New Comment:
My web development is on Windows 2000 Professional.
I had a problem with the submit as well. My original code made
reference to the variable as $zip and wouldn't work.
This works:
<html>
<head>
<title>Zip Code Checker</title>
</head>
<body>
<?php
if(isset($_POST["submit"]))
{
$zip = trim($HTTP_POST_VARS["zip"]);
$zip_length = strlen($HTTP_POST_VARS["zip"]);
$zip_test = substr($HTTP_POST_VARS["zip"], -5, 1);
if(($zip_length > '5' && $zip_test != '-') || ($zip_length < '5'))
{
?>
<p>That doesn't appear to be a valid ZIP or ZIP+4 ZIP code.</p>
<p>ZIP codes should be in the format of "12345" or "12345-1234".</p>
<?
}
else
{
echo("Zip code entered is valid!");
}
}
else
{
?>
<form action="zip_check.php" method="POST" name="zipform"
id="zipform">
Please enter your ZIP code:
<input type="text" name="zip" size="10" maxlength="10">
<input type="submit" name="submit" value="Submit!">
</form>
<?
}
?>
</body>
</html>
Previous Comments:
------------------------------------------------------------------------
[2003-06-05 00:26:53] [EMAIL PROTECTED]
And how is PHP setup in your win32 environment then?
------------------------------------------------------------------------
[2003-06-05 00:18:07] xiongwei at aerafront dot com
I figure it out! perhaps,
No problem under linux + apache environment, but it still is a bug on
WIN32 platform.
William Hong
------------------------------------------------------------------------
[2003-06-04 22:24:32] xiongwei at aerafront dot com
I wrote a routine "postrawdata.php" for displaying HTTP raw request
message.
<?php
$putdata = fopen( "php://input" , "rb" );
while(!feof( $putdata ))
echo fread($putdata, 4096 );
fclose($putdata);
?>
It works properly when using a socket program to post something to it.
But submitting from a simple HTML below will make it dead, even http
headers were not sent back, the behavior of brwoser is just waiting
before timeout, I have tested it under IE 6.0 and Netscape 7.0 , any
suggestion is appreciate.
<body>
<form name="form1" method="post" action="postrawdata.php">
<input type="text" name="name" >
<input type="submit" name="Submit" value="Submit">
</form>
</body>
I think PHP does not send correct responding data to browser, or it
does not disconnect the HTTP channel, that makes browsers to wait ,
whereas my socket client do disconnect when finished.
Thanks,
William Hong
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24028&edit=1