php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24143 when using eurosign in form, first post variable is lost
Submitted: 2003-06-12 04:18 UTC Modified: 2003-06-12 05:37 UTC
From: dradu at dudici dot dk Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 4.3.2 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dradu at dudici dot dk
New email:
PHP Version: OS:

 

 [2003-06-12 04:18 UTC] dradu at dudici dot dk
Description:
------------
I have a form with some input fields (text & radios - see the attached script).
When I enter the eurosign in one of the text fields and submit, the first post variable is lost, i.e. does not appear in $_POST.

I can reproduce the error in the following conditions:
- The page's charset = ISO-8859-1 (maybe also with other ISO-8859)
- The form's method=POST & enctype=multipart/form-data
- Right before the submit button is a radio (or checkbox) input and I DO NOT check the last radio option
- I type the eurosign character (I think code 80hex, Alt+0128) in a text field
- Browser is IE

I used PHP binaries v.4.3.2 on Windows 2000 & XP/IIS with IE 6.0
No special changes in php.ini (except maybe upload_max_filesize=5M and post_max_size=8M)

I have attached the script I used. Do you know what is happening? Why this behaviour? 

Maybe you have a solution ...

Thanks,
Radu Dudici




Reproduce code:
---------------
<html>
<head>
<title> i-Term </title> 
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
</head>
<body >
POST data:<br><pre>
<?
print_r ($_POST);
?>
</pre>
<form enctype="multipart/form-data" action="tst1.php" method="post" >
Test: <input type=text name='test' value="1">
<p>Comment:<p><textarea class="tbltxt" style='width: 320px' cols=50 name="comment" rows="1" ><?=@$_POST['comment']?></textarea>
<p>Radios:<br>
<input type=radio name="radios" value=1 > radio 1
<input type=radio name="radios" value=2 > radio 2
<p><input type=submit>  
</form>
</body></html>


Expected result:
----------------
I expect to have all the post variables from the form into $_POST array in PHP also when using eurosign character.

Actual result:
--------------
When entering the eurosign in a text field, and under the conditions described above, the first post variable from the form is lost, i.e. does not appear in $_POST array.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-12 05:37 UTC] sniper@php.net
Euro-sign is only in ISO-8859-15, just change this:

<meta http-equiv='Content-Type' content='text/html;
charset=iso-8859-1'>

to this:

<meta http-equiv='Content-Type' content='text/html;
charset=iso-8859-15'>

And it will work. This has nothing to do with PHP,
seems like at least IE sends broken data when
the charset is wrong, you can test this yourself with this
perl script which prints the raw data:

post-test.cgi:
--------------8<----------------------
#!/usr/bin/perl                                                                               
   
print "Content-type: text/html\n\n";

if ($ENV{'REQUEST_METHOD'} eq "POST") {
  read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
  print "<pre>\n$buffer\n</pre>\n";
} 
--------------8<----------------------

 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 31 19:01:27 2021 UTC