|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2009-03-07 06:37 UTC] diego at freagair dot com
 Description: ------------ A user types in a color into an input box, it is then sent via ajax "GET" or "POST" to dynamically color any given "DIV", via "style.backgroundColor" or "color". More specific information about the issue located at the MSDN IE Forums: http://urloid.com/iebug2 It seems that the problem is generated by some whitespace in the PHP string 00380023 00380038 0000000a This whitespace problem occurs with (Debian) and (FreeBSD) Reproduce code: --------------- A white space is passed after any value, the error can be seen using any IE 6-8 http://89.233.173.91/bug/ Expected result: ---------------- I would expect for the value to not contain any whitespace. Example: "#333" is turned into "#333 " which causes errors with all Internet Explorer versions Actual result: -------------- Example at http://89.233.173.91/bug/ totally fails a very simple AJAX/ DOM script, because the PHP value contains a whitespace PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 23:00:01 2025 UTC | 
Hello I have tried the following code below, but still seem to get the extra white space. The values have been passed via AJAX POST and GET but to no avail. All the commented code has also been used. <?php //$paint = $_GET['paints']; $paint = $_POST['paints']; //PREVIEW COLOR #echo trim($paint); #echo '#AB1616'; $newStr = ereg_replace('[[:space:]]+', '', trim($paint)); echo $newStr; #echo $paint; echo trim($paint); ?>