Welcome to WebmasterWorld Guest from 54.226.189.112

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

special characters in form input since php 5

     

newbies

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

10+ Year Member



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.

penders

8:34 am on Feb 13, 2014 (gmt 0)

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



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?

newbies

4:07 pm on Feb 13, 2014 (gmt 0)

10+ Year Member



That happens when the form has been submitted. Thank you.

coopster

7:26 pm on Feb 20, 2014 (gmt 0)

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



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...]

lucy24

11:23 pm on Feb 20, 2014 (gmt 0)

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



:: 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.

newbies

4:08 pm on Feb 21, 2014 (gmt 0)

10+ Year Member



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month