Basic WiFly server returning unexpected output within web client
Your browser sent a HTTP GET request. You need to send a HTTP response in kind, in accordance with the protocol, for your browser to correctly interpret the data. Something like this should do:

  #define TIMEOUT 100
  char response[] = "&lt;HTML&gt;&lt;BODY&gt;&lt;H1&gt;Hi&lt;/H1&gt;&lt;P&gt;This is text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;";
  unsigned long lastRead;
  ...

  while (client.connected()){
    if (client.available()){
      lastRead = millis();
      while (millis() - lastRead &lt; TIMEOUT){
        while (client.available()){
          Serial.write(client.read());
          lastRead = millis();
        }
      }
      client.println("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nConnection: closed\r\n\r\n");
      client.print(response);
      break;
    }
  }
  delay(1000);
  client.stop();


EDIT:

It turns out that the Wifly shield sends a response status as well as "HELLO" by default. You have to disable that with a few commands:

set comm remote 0
set comm open 0
set comm close 0


This will ensure that "HELLO" isnt sent each time a client connection is made, though I'm not sure if this affects the default HTTP/0.9 200 OK response status that is always sent. You can try the sketch above with and without the response header to see what you get.