Arduino web server icons

Hi everyone.
After a lot of projects I have stuck with this one because it is the first time I try to use Arduino as web server.
I can not whatever I tried to make png icons to appear on my web page.
Below you can find the code and the html file.
Any help appreciated.

arduino_code.txt (9.65 KB)

htm_file.txt (3.76 KB)

And this is the serial outpout. Everythin seems to be working ok except those icons won't appear.

ET /on.png HTTP/1.1
Host: 192.168.0.177
Connection: keepGET /ajax_inputs&nocache=309789.47214469896 HTTP/1.1
Host:GET /ajax_inputs&nocache=626571.1442914985 HTTP/1.1
Host: GET /on.png HTTP/1.1
Host: 192.168.0.177
Connection: keepGET /ajax_inputs&nocache=227596.5004463627 HTTP/1.1
Host: GET /on.png HTTP/1.1
Host: 192.168.0.177
Connection: keepGET /ajax_inputs&nocache=836857.8211279472 HTTP/1.1
Host: GET /on.png HTTP/1.1
Host: 192.168.0.177
Connection: keepGET /ajax_inputs&nocache=348584.1436177592 HTTP/1.1
Host: GET /on.png HTTP/1.1
Host: 192.168.0.177
Connection: keepGET /ajax_inputs&nocache=203379.9663495739 HTTP/1.1
Host: GET /on.png HTTP/1.1
Host: 192.168.0.177
Connection: keepGET /ajax_inputs&nocache=11157.308209599925 HTTP/1.1
Host:GET /on.png HTTP/1.1
Host: 192.168.0.177
Connection: keepGET /ajax_inputs&nocache=950486.7958525305 HTTP/1.1
Host: GET /on.png HTTP/1.1
Host: 192.168.0.177
Connection: keepGET /ajax_inputs&nocache=497285.0616728399 HTTP/1.1
Host: GET /on.png HTTP/1.1
Host: 192.168.0.177
Connection: keepGET /ajax_inputs&nocache=504039.0535269006 HTTP/1.1
Host: GET /on.png HTTP/1.1
Host: 192.168.0.177
Connection: keepGET /ajax_inputs&nocache=970828.8935550593 HTTP/1.1
Host: GET /on.png HTTP/1.1
Host: 192.168.0.177
Connection: keepGET /ajax_inputs&nocache=193893.3560020779 HTTP/1.1
Host: GET /on.png HTTP/1.1
Host: 192.168.0.177
Connection: keep

When the client makes a request for the png file, what do you ACTUALLY return? Not the requested png file...

Hi thanks for the reply, but could you please be more specific as i am not a programmer, just a netwoking admin doing this for hobby and just adjusting code from here and there.
If you could explain a little bit more i might could understand what the problem is as i have no idea of coding!!!!
Thank you once more.

could you please be more specific

Look at your code. The client requests index.htm. What, exactly, do you return?

The client requests on.png. What, exactly, do you return?

In the first case, you send a content statement and then the contents of a file.
In the second case, you send a content statement and nothing else.

Where IS the client supposed to get the on.png data from if you don't send it?

 else if (StrContains(HTTP_req, "GET /on.png")) {
    webFile = SD.open("on.png");
    if (webFile) {
        client.println("HTTP/1.1 200 OK");
        client.println();
    }
}

I added this to my arduino code but still nothing.What else am i missing??

What else am i missing??

You have a block of code that deals with index.htm. You have a block of code that deals with on.png.

Print each section of code on a separate piece of paper. Compare them line-by-line.

In the index.htm code, you actually read the file and print it to the client. In the on.png code, you open the file, but don't bother reading it or printing it to the client. Why?

(You'll actually need to write() it to the client, since it does not contain ASCII data.)

So i have to ad this on the on.png part on my arduino code????

if (webFile) {
                            while(webFile.available()) {
                                client.write(webFile.read()); // send web page to client
                            }
                            webFile.close();
                        }

So i have to ad this on the on.png part on my arduino code?

Something like that, yes. Sending one byte per packet is wasteful, though. The read() method is overloaded to take an array and a size (the size of the array), and return the number of characters read. The write() function is also overloaded to take an array and a size. Set up a 32 byte array, and read up to 32 bytes. write() the bytes actually read (may be less than 32).

Hello everyone,
After lots of research on arduino and esp8266, I am stuck on a problem that is

how I connect my arduino using esp8266 module to mysql (localhost) server in my laptop. So that i will enter data on my server.

I am using php file and GET method for sending data on my localhost but when i use send command data is not come on my server. So please help me.

i finally resolved my problem by adding in the html code the jpg images ψονωερτεδ to base64 format.
I gave up trying doing it the "right way".
Nevertheless thank you for your time and patience.