Solved

PHP echo Displaying HTML Code, Not Desired HTML Content

Posted on 2012-03-30
3
367 Views
Last Modified: 2012-03-30
In the following page, notice the section "Product Information" http://goo.gl/pRk70

Why won't this content display properly?  It's acting like I've used htmlspecialchars or htmlentities but I haven't.

The database entry is as such:

<font size="1" face="Univers-CondensedLight"><font size="1" face="Univers-CondensedLight">• Easily switches between speakerphone, headset, and handset modes</font></font><p align="LEFT"><font size="1" face="Univers-CondensedLight"><font size="1" face="Univers-CondensedLight">• 32-character LCD display shows number dialed, length of call, and other useful information</p><p>
• 36-entry phone book</p><p>
• 99-number incoming and outgoing call history directories let you easily access past call information</p><p>
• Mute button allows private off-line conversation without other party hearing your conversation</p><p>
• Caller ID with on Call Waiting</p><p>
• Distinctive rings for each line</p><p>
• One-touch speed dial and search/sort speed dialing</p><p>
• Repetitive redial</p><p>
• FSK and expanded PBX message waiting indicator</p><p>
• Nonvolatile RAM protects stored information if power is lost</p></font></font>
0
Comment
Question by:EMB01
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 37789399
You can use htmlspecialchars_decode http://us2.php.net/manual/en/function.htmlspecialchars-decode.php to take care of that part of the problem.  You also have a character set mismatch as shown by the " â€¢ FSK ".  That's usually when you are showing UTF8 characters on a Latin1 page (which you are doing).
0
 
LVL 14

Author Closing Comment

by:EMB01
ID: 37789631
Thanks, this wasn't the whole problem, though.  The other part was that I wasn't allowing special characters into my database (dumb on my part, didn't realize at first).
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 37789638
You're welcome, glad you got it fixed.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question