hey guys im having trouble getting a message to appear for anyone using internet explorer. my website is standards compliant so it does not show in IE. i had one of my friends modify his warning script that he used for his site for mine. it uses both php and html. the part that displays is html. and the part that processes it is the php i believe. any how there is something missing from the html thats causing it to not show and i dont know why. i put it through the w3c validator and this time got back a tenatively validated and said there was some kind of error so it had to result back to the utf-8. the exact error message is

No Character Encoding Found! Falling back to UTF-8.

I was not able to extract a character encoding labeling from any of the valid sources for such information. Without encoding information it is impossible to reliably validate the document. I'm falling back to the "UTF-8" encoding and will attempt to perform the validation, but this is likely to fail for all non-trivial documents.

so this time to get more details about it i check marked show source, show parse tree, validate error pages, show out line, verbose output. this is the more detailed report i got


No Character Encoding Found! Falling back to UTF-8.

I was not able to extract a character encoding labeling from any of the valid sources for such information. Without encoding information it is impossible to reliably validate the document. I'm falling back to the "UTF-8" encoding and will attempt to perform the validation, but this is likely to fail for all non-trivial documents.

The sources I tried to find encoding information include:

* The HTTP Content-Type field.
* The XML Declaration.
* The HTML "META" element.

And I even tried to autodetect it using the algorithm defined in Appendix F of the XML 1.0 Recommendation.

Since none of these sources yielded any usable information, I will not be able to reliably validate this document. Sorry. Please make sure you specify the character encoding in use.

Specifying a character encoding is normally done in the web server configuration file or administration program. The W3C I18N Activity has collected a few tips on how to do this in popular web server implementations.

IANA maintains the list of official names for character sets and the WDG has some information to help you correctly specify the character encoding.

To quickly check whether the document would validate after addressing the missing character encoding information, you can use the "Encoding" form control earlier in the page to force an encoding override to take effect. "iso-8859-1" (Western Europe and North America) and "utf-8" (Universal, but not commonly used in legacy documents) are common encodings if you are not sure what encoding to choose.

any ideas of what going on? the UTF-8 is in the php code so could this have anything to do with it?

A lack of character encoding shouldn't cause your alert not to display, but try using

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

on your html page instead.

Can you post some code for us to see?

A lack of character encoding shouldn't cause your alert not to display, but try using

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

on your html page instead.

Can you post some code for us to see?

sure here it is

<?php
  $UA = $_SERVER['HTTP_USER_AGENT'];
  if ((!preg_match('#(opera)#si', $UA)) && (!preg_match('#(firefox)#si', $UA)) && (!preg_match('#(safari)#si', $UA)))
  {
  # IE stuff
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!-- P: Annotated. Read. Learn. Never ever blight the world with tables and inline styles again. -->
<html>
  <head>
		<title>GET LOST IE!</title>
		<meta name="description" content="Official Website of The Underground NJ Student Ministries" />
		<link rel="stylesheet" type="text/css" href="chrometheme/chromestyle2.css" />
    <link href="style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="chromejs/chrome.js" />
  </head>
	<body>
    <p>Warning, warning your browser SUCKS! get Firefox, Opera or Safari if you want to see this page</p>
	</body>
</html>
<?php
  die();
  }
  # End of IE stuff

  # Do not mess with this, for F and everything else good.

  echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>

thats the section that caused my code to be tenatively valid but if you remove that and restore the php code the original my code is valid. also if you find anything that might be causing the page to not load in opera please let me know as i cant find where the problem is.

ok so i talked to my friend who is with the same hosting company as me and turns out i had to customize my own warning in php im guessing though why he put "your browser sucks get firefox" i dont know. so my only problem now is getting my page to view in Opera any ideas?

<?php
  $UA = $_SERVER['HTTP_USER_AGENT'];
  if ((!preg_match('#(opera)#si', $UA)) && (!preg_match('#(firefox)#si', $UA)) && (!preg_match('#(safari)#si', $UA)))
  {
  # IE stuff
?>

Missing } ?? or is that because of your edit?


Which mode is Opera in? Opera has an 'identify as IE mode' - on the quick preferences options.

<?php
  $UA = $_SERVER['HTTP_USER_AGENT'];
  if ((!preg_match('#(opera)#si', $UA)) && (!preg_match('#(firefox)#si', $UA)) && (!preg_match('#(safari)#si', $UA)))
  {
  # IE stuff
?>

Missing } ?? or is that because of your edit?


Which mode is Opera in? Opera has an 'identify as IE mode' - on the quick preferences options.

for whatever reason my friend put in {

and

}

but the code is different now and it works. as for Opera i just switched it to Opera and its still showing up blank :(

just tried setting it as mozilla and still came up blank

Its something in the javascript file you are linking to: ( i don't know what )

<script type="text/javascript" src="chromejs/chrome.js" />

remove that and it displays in IE...

yeah im going to get rid of that alls that is, is our drop down menu for our nav bar going to be converting that into dynamic css. thanks for letting me know that. didnt know that javascript would cause Opera to do that. thanks again! :)

::edit::

i dont want it to display in IE. as long as it's standards compliant it shouldn't. did you mean opera?

The warning for Internet Explorer did not display in Internet Explorer. I thought that was your problem?? The warning did not display for me in internet explorer, but when I removed the line including the javascript it showed up just fine. So the warning would show in Internet Explorer like it was supposed to...

i solved that problem a couple days ago. my friend set it up differently for me and now it displays either way. so im guessing it the javascript thats blocking the page from loading in opera

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.