Welcome to WebmasterWorld Guest from 54.144.206.73

Forum Moderators: open

  changes to  

   
7:53 pm on Feb 13, 2009 (gmt 0)

5+ Year Member



I don't know if this is a php or a mysql question.

The mysql variable contains:

    This is an indented item.

When it is retreived and output to the page,   is changed to  

with the result that the page is rendered as:

    This is an indented item.

instead of as

This is an indented item.

7:54 pm on Feb 13, 2009 (gmt 0)

5+ Year Member



That is
[four blank spaces]This is an indented item.
8:01 pm on Feb 13, 2009 (gmt 0)

5+ Year Member



It's hard to ask questions using these codes. The page contains:

    This is an indented item.

instead of

    This is an indented item.

So the page renders with the actual & n b s p ; characters instead of using blank spaces.

I notices the database had no collation for this column. I tried changing the collation utf8-unicode-ci then I re-updated the column value but the result was still the same. I also tried ascii-general-ci.

Perhaps the problem isn't in mysql but in the php that is retrieving it?

I'm at a new host with a new small mini cms module with an impatient client who just wants to get rid of the   characters.

(Of course, it's doing the same with dashes etc. The input is from html generated by openoffice.)

9:20 pm on Feb 13, 2009 (gmt 0)

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



Perhaps the problem isn't in mysql but in the php that is retrieving it?

Or the programmer that coded the PHP :)
If the data in the database table column is already HTML, which it is according to your description, then you seemingly telling PHP somewhere in there to html entity encode the text before displaying it. If you are using htmlentities [php.net], htmlspecialchars [php.net] or something along those lines you are converting the data before it gets sent to the browser which in turn will not render the HTML as you prefer because you have converted the entities. Search your code after the data has been retrieved to see if you can find either of those functions or something similar that is converting your html entities.

9:41 pm on Feb 13, 2009 (gmt 0)

5+ Year Member



THANK YOU

htmlspecialcharacters was the culprit

 

Featured Threads

Hot Threads This Week

Hot Threads This Month