Welcome to WebmasterWorld Guest from 54.166.146.212

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

special characters in form input since php 5

     
3:26 am on Feb 13, 2014 (gmt 0)

Full Member

10+ Year Member

joined:Apr 19, 2003
posts: 282
votes: 0


I run a job board (jamit). Recently I upgraded my server to Apache 2.4.7 and PHP to 5 (5.4.25). Since that, special characters such as ( ) appear in form input (textarea field). I am sure before the upgrade, there was no such issue. I believe it was caused by the new version of Php.

Since jamit board has stopped development. I really need to solve this issue otherwise I have to edit manually ever job post.

Than you in advance for your input.
8:34 am on Feb 13, 2014 (gmt 0)

Senior Member

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2006
posts: 3123
votes: 0


At what point do these special characters appear? When the form is first displayed and is empty? Or when redisplaying already submitted data?

This looks like a character encoding issue? This might even be coming from your database?
4:07 pm on Feb 13, 2014 (gmt 0)

Full Member

10+ Year Member

joined:Apr 19, 2003
posts: 282
votes: 0


That happens when the form has been submitted. Thank you.
7:26 pm on Feb 20, 2014 (gmt 0)

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12547
votes: 2


Just taking a wild guess here but since you mentioned the upgrade to PHP 5.4.x and if you were not serving your pages as utf-8 before it may be the default_charset. Here is the note from the changelog, particularly the entry found in 5.4.0 itself:

Changed default value of "default_charset" php.ini option from ISO-8859-1 to UTF-8.

[php.net...]


The directive: [php.net...]
11:23 pm on Feb 20, 2014 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:13740
votes: 459


:: detour to look up ::

Acircum = C2 (8859-1) and C382 (UTF-8)
82 (8859-1) = "break permitted here" = C282 (UTF-8)

Bingo. What does "break permitted here" mean? Something involving form submission, I'd have to guess.

The moment you see Acircum or Atilde, you can say with 99.99% certainty that it's a file-encoding mismatch.
4:08 pm on Feb 21, 2014 (gmt 0)

Full Member

10+ Year Member

joined:Apr 19, 2003
posts: 282
votes: 0


Thanks you both for answering me. So I looked at php configuration, and found the default_charset was actually iso-8859. So I changed it to UTF-8 and solved the problem.