Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-17-2013, 12:36 AM   PM User | #1
frank727
New Coder

 
Join Date: Sep 2007
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
frank727 is an unknown quantity at this point
Character encoding help

My PHP file is giving me the dreaded "The character encoding of the HTML document was not declared" error.

I added the following in my header section but it didn't help.

PHP Code:
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<
meta content="utf-8" http-equiv="encoding"
Thanks for any help...
frank727 is offline   Reply With Quote
Old 03-17-2013, 02:56 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,399
Thanks: 18
Thanked 352 Times in 351 Posts
sunfighter is on a distinguished road
Quote:
giving me the dreaded
Sounds like this is happening all the time. Personally I have never seen it.

Don't think that is coming from php, but your html is having trouble with the php feedback(?) Post the php code here or at lest what your echoing back.
sunfighter is offline   Reply With Quote
Old 03-17-2013, 04:06 PM   PM User | #3
frank727
New Coder

 
Join Date: Sep 2007
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
frank727 is an unknown quantity at this point
See attachment. This is from Firefox's web console debugging tool. And yes, most of my .php pages show this error.
Attached Thumbnails
Click image for larger version

Name:	00.jpg
Views:	8
Size:	26.7 KB
ID:	11994  
frank727 is offline   Reply With Quote
Old 03-18-2013, 12:16 AM   PM User | #4
Arbitrator
Senior Coder

 
Arbitrator's Avatar
 
Join Date: Mar 2006
Location: Splendora, Texas, United States of America
Posts: 2,907
Thanks: 6
Thanked 191 Times in 188 Posts
Arbitrator is on a distinguished road
Quote:
Originally Posted by frank727 View Post
See attachment. This is from Firefox's web console debugging tool. And yes, most of my .php pages show this error.
The easiest way to specify the encoding of all of your HTML documents is to declare it site-wide using an HTTP header; just make sure every document actually conforms to that encoding. For example, if using Apache, you can put AddType UTF-8 .html in a .htaccess file to specify that the encoding of all HTML files with that particular extension is UTF-8.

Quote:
Originally Posted by frank727 View Post
PHP Code:
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<
meta content="utf-8" http-equiv="encoding"
The second line is not a correct way to specify encoding. The HTML4/5 way to do it is via the first line. The HTML5-specific way is through <meta charset="UTF-8">.
__________________
Please for the love of god stop making IE. You current "browser"s cause me to cry every day. —Phil *
Arbitrator is online now   Reply With Quote
Users who have thanked Arbitrator for this post:
frank727 (03-18-2013)
Old 03-18-2013, 04:00 AM   PM User | #5
frank727
New Coder

 
Join Date: Sep 2007
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
frank727 is an unknown quantity at this point
Thanks...
frank727 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:06 AM.


Advertisement
Log in to turn off these ads.