|  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
 [2003-06-12 04:18 UTC] dradu at dudici dot dk
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 ...

Radu Dudici

Reproduce code:
<title> i-Term </title> 
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<body >
POST data:<br><pre>
print_r ($_POST);
<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>
<input type=radio name="radios" value=1 > radio 1
<input type=radio name="radios" value=2 > radio 2
<p><input type=submit>  

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.


Add a Patch

Pull Requests

Add a Pull Request


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

<meta http-equiv='Content-Type' content='text/html;

to this:

<meta http-equiv='Content-Type' content='text/html;

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:

print "Content-type: text/html\n\n";

  read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
  print "<pre>\n$buffer\n</pre>\n";

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