Welcome to WebmasterWorld Guest from 54.167.46.29

Forum Moderators: open

Message Too Old, No Replies

  changes to  

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

New User

5+ Year Member

joined:Dec 21, 2008
posts: 19
votes: 0


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)

New User

5+ Year Member

joined:Dec 21, 2008
posts: 19
votes: 0


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

New User

5+ Year Member

joined:Dec 21, 2008
posts: 19
votes: 0


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)

Administrator

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

joined:July 31, 2003
posts:12533
votes: 0


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)

New User

5+ Year Member

joined:Dec 21, 2008
posts: 19
votes: 0


THANK YOU

htmlspecialcharacters was the culprit

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members