Solved

PHP echo Displaying HTML Code, Not Desired HTML Content

Posted on 2012-03-30
3
355 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 82

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 82

Expert Comment

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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now