webpage ethernetshield blank with IE ??

Hi all,

I'm using an ethernetshield on the arduino, and got the webserver running. Strange thing is if i use firefox/chrome the page appears as aspected. BUT if i open it with internetexplorer 8 (windows 7 machines) the page is blank. It'connects, but blank. First i thought it was a bug in IE, but that was for older versions. I can't find the problem.

here's the code

/*
 * A webserver for project DOMEKAN, HAN 2010
 * Marcel vd Kamp
 */

#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,1,110 };

Server server(4500);

int PIRpin = 2;
int value = 0;
int ledpin = 13;

void setup()
{
  Ethernet.begin(mac, ip);
  server.begin();
  
  pinMode (PIRpin, INPUT);
  pinMode (ledpin, OUTPUT);
}

void loop()
{
  Client client = server.available();
  if (client) {
    // an http request ends with a blank line
    boolean current_line_is_blank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        // if we've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so we can send a reply
        if (c == '\n' && current_line_is_blank) {
          // send a standard http response header
          client.print("<head>");
          client.print("<HTTP/1.1 200 OK>");
          client.print("<Content-Type: text/html>");
          client.print("<META HTTP-EQUIV=REFRESH content=5 url='http;//192.168.1.110' >");
          client.println();
          // webpagina inserten
          client.print("<title>Arduino webserver voor PIR</title>");

          client.print("</head>");

 client.print("<body bgcolor= #0000FF");
 client.print("text= #333333");
 client.print("<h2><strong>Webserver voor signalen van PIR's Aangesloten op de arduino</strong></h2>");
 client.print("<p>&lt;marcel van de kamp, 2010&gt;</p>");
 client.print("<p>&nbsp;</p>");

 value = digitalRead(PIRpin);
      if (HIGH == value) {
        digitalWrite(ledpin, HIGH);
           client.print("<h3>koekoek, marcel zit achter zijn PC</h3>");
          }
          else
          {
            digitalWrite(ledpin, LOW);
            client.print("geen activiteit");
          }

 client.print("<p align= left >Signaal van PIR 1: </p>");
 client.print("<p align= left >Signaal van PIR 2: </p>");
 client.print("<p align= left >Signaal van PIR 3: </p>");
 client.print("<p align= left >&nbsp;</p>");
 client.print("</body>");
 client.print("</html>");
          // einde
   break;       

      
        }
        if (c == '\n') {
          // we're starting a new line
          current_line_is_blank = true;
        } else if (c != '\r') {
          // we've gotten a character on the current line
          current_line_is_blank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);
    client.stop();
   
  }
}

Has anybody come across this problem and solved it ??

On both browsers, use the "View Page Source" option. See what the browser has actually received. Try copying the text to a file, with .html extension, and open that file in each browser.

One thing that does not appear right is this:

 client.print("<p align= left >Signaal van PIR 1: </p>");

The book I looked at suggests it should be this:

 client.print("<p align= [glow]\"[/glow]left[glow]\"[/glow] >Signaal van PIR 1: </p>");

The value (left) needs to be in quotes.

Thx for the fast reply. There are some things not right in the HTML code. HTML validator got me on the right track. By now its working on IE too!!! ;D ;D

But with serveral errors, got to get that straight to :-[

This is part of a project involving domotica. It will have server, camera's, detection, automated locks and other goodies too :o

Sometimes IE is picky. (Allways actually).

Try putting a doctype like this:

before the

It sometimes helps putting IE back on tracks

client.print("<META HTTP-EQUIV=REFRESH content=5 url='http;//192.168.1.110' >");

replace the ; with a :
client.print("");