need help!!!!!!Please!!

web server for led control
but the web refresh when the led on,the led is always on whatever i do
please help

code:

#include <SPI.h>
#include <String.h>
#include <Ethernet.h>

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x9B, 0x36 }; // Endereço Mac
byte ip[] = { 192, 168, 199, 111 }; // Endereço de Ip da sua Rede
EthernetServer server(80); // Porta de serviço

int light = 5;

String readString = String(30);
String statusLed;

void setup(){
Ethernet.begin(mac, ip);

pinMode(light, OUTPUT);

Serial.begin(9600);
}

void loop(){

EthernetClient client = server.available();

if (client) {
while (client.connected())
{
if (client.available())
{
char c = client.read();

if (readString.length() < 30)
{

readString += (c);
}

if (c == '\n')
{
if (readString.indexOf("light") > 0) {
digitalWrite(light,!digitalRead(light));
}

client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();

client.println("");
client.println("<!doctype html>");
client.println("");

if(digitalRead(light)){ statusLed = "on"; } else { statusLed = "off"; }
client.println("

Lampada 1 - "+statusLed+"<\/button> ");

client.println("");

readString="";

client.stop();
}
}
}
}
}

Please go back and read How to use the forum. After that, please change your post to contain code-tags around the code and a useful title. We know you want help, that's why you are here... But what is he problem about?

And I think a better problem description would help. And more details om what you tried. Did you (blindly) copy this piece of code?

Could it be that your browser request is more then 30 characters long and the word 'light' does not appear in the first 30 characters?

String readString = String(30);

This is equivalent to

String readString = "30";

That hardly seems like a useful initial value.

      if (client.available())
      {
        char c = client.read();
       
        if (readString.length() < 30)
        {

Before you try parsing anything, it is a good idea to know WHAT you are parsing. Print what is in readString, to see if it is what you think it is.