Arduino Ethernet Image

Good morning everyone, I’ve solved the problem of the size of the butts for my web page and everything works fine.
Now I ask for help for the following problem, I would like to put an image of a light bulb and when I press Turn off Light I put an image of a light bulb off and Turn on Light one on.
The code is as follows:

//-------------------------------------------------------------------------------------------------------
#include <SPI.h>
#include <Ethernet.h>

// Enter a MAC address and IP address for your controller below.
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

// The IP address will be dependent on your local network:
// assign an IP address for the controller:

IPAddress ip(192,168,1,155);
IPAddress gateway(192,168,1,1);
IPAddress subnet(255, 255, 255, 0);

// Initialize the Ethernet server library with the port you want to use.
EthernetServer server(80);
String readString;
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------
// Any extra codes for Declaration :

// Declare Pin 8 as an LED because thats what we will be connecting the LED to.You could use any other pin and would then have to change the pin number.
int led = 13;

//-------------------------------------------------
//-------------------------------------------------------------------------------------------------------
void setup()
{
//-------------------------------------------------

// Extra Set up code:
pinMode(led, OUTPUT); //pin selected to control

//-------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//enable serial data print
  Serial.begin(9600);

  //start Ethernet
  Ethernet.begin(mac, ip, gateway, subnet);
  server.begin();
  Serial.print("Server is at ");
  Serial.println(Ethernet.localIP());
  Serial.println("LED Controller Test 1.0");
}
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------

void loop()
{
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client)

  {
    Serial.println("new client");

    while (client.connected())
    {
      if (client.available())

      {
        char c = client.read();

        //read char by char HTTP request
        if (readString.length() < 100)

        {

          //store characters to string
          readString += c;
          //Serial.print(c);


          Serial.write(c);
          // if you've gotten to the end of the line (received a newline
          // character) and the line is blank, the http request has ended,
          // so you can send a reply
          //if HTTP request has ended
          if (c == '\n') {
            Serial.println(readString); //print to serial monitor for debuging
//--------------------------------------------------------------------------------------------------------
// Needed to Display Site:
client.println("HTTP/1.1 200 OK"); //send new page
            client.println("Content-Type: text/html");
            client.println();
            client.println("<HTML>");
            client.println("<HEAD>");

//--------------------------------------------------------------------------------------------------------
//-------------------------------------------------

// what is being Displayed :     
            client.println("<TITLE>Cascina Mozzini</TITLE>");
            client.println("<center>");
            client.println("</HEAD>");
            client.println("<BODY>");
            client.println("<H1>Cascina Mozzini</H1>");
            client.println("<img src=\"https://static.vecteezy.com/system/resources/previews/000/140/802/non_2x/mountain-chalet-house-vector.jpg\") style=\"width: 30%; margin-left: auto; margin-right: auto; display: block;\" />");

            client.println("<hr />");
            client.println("<center>");
            
            client.println("<a href=\"/?Lighton\"\"><button style='font-size:170%;background-color:darkgray; color:green; border-radius:50px; position:absolute; top:430px; left:450px;'>Turn On Light</button></a>");
            
            client.println("
");
            client.println("
");
            
            client.println("<a href=\"/?Lightoff\"\"><button style='font-size:170%;background-color:darkgray; color:green; border-radius:50px; position:absolute; top:430px; right:450px;'>Turn off Light</button></a>");
                 

            client.println("</BODY>");
            client.println("</HTML>");

            delay(1);
            //stopping client
            client.stop();

            //-------------------------------------------------
            // Code which needs to be Implemented:
            if(readString.indexOf("?lighton") >0)//checks for on
            {
              digitalWrite(led, HIGH);    // set pin 8 high
              Serial.println("Led On");
            }
            else{
              if(readString.indexOf("?lightoff") >0)//checks for off
              {
                digitalWrite(led, LOW);    // set pin 8 low
                Serial.println("Led Off");
              }
            }
            //clearing string for next read
            readString="";

            // give the web browser time to receive the data
            delay(1);
            // close the connection:
            client.stop();
            Serial.println("client disonnected");

          }
        }
      }
    }
  }
}

I thought I’d add the image in this part of the program:

if(readString.indexOf("?lighton") >0)//checks for on
            {
              
              ent.println("<img src=\"https://static.vecteezy.com/system/resources/previews/000/140/802/non_2x/mountain-chalet-house-vector.jpg\") style=\"width: 30%; margin-left: auto; margin-right: auto; display: block;\" />");

              digitalWrite(led, HIGH);    // set pin 8 high
              Serial.println("Led On");
            }

Should I put other directions like location? What’s wrong?
It gives me a compilation error and I don’t understand, for now the image that I publish is the same as the one on the cover, but it’s just a proof. :confused:

press CTRL-T to format your code - you probably see your error then.

ent.println("<img src=“https://static.vecteezy.com/system/resources/previews/000/140/802/non_2x/mountain-chalet-house-vector.jpg”) style=“width: 30%; margin-left: auto; margin-right: auto; display: block;” />");

and please … clean up your comments:

// Declare Pin 8 as an LED because thats what we will be connecting the LED to.You could use any other pin and would then have to change the pin number.
int led = 13;

and think about your used variables … 13 doesn’t neet do be an int. use a byte.
and it doesn’t change any more - so make it
const byte led = 13;

when you code compiles, check your generated html in a W3C Markup validator.