Solved

PHP echo Displaying HTML Code, Not Desired HTML Content

Posted on 2012-03-30
3
388 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

688 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