For a question in forum this is a working example, there will be the example that is not working
Fork of eth_v13 by
html.h@3:79dc3337d9da, 2014-03-21 (annotated)
- Committer:
- hggerdd
- Date:
- Fri Mar 21 00:18:33 2014 +0000
- Revision:
- 3:79dc3337d9da
- Parent:
- 2:8f5bacfef390
- Child:
- 4:a10e3d1bdb17
webserver;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hggerdd | 2:8f5bacfef390 | 1 | #ifndef HTML_H_ |
hggerdd | 2:8f5bacfef390 | 2 | #define HTML_H_ |
hggerdd | 2:8f5bacfef390 | 3 | |
hggerdd | 3:79dc3337d9da | 4 | /* |
hggerdd | 2:8f5bacfef390 | 5 | const char html_head[] = "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nPragma: no-cache\r\n\r\n" \ |
hggerdd | 2:8f5bacfef390 | 6 | "<html>\r\n<body>\r\n" \ |
hggerdd | 2:8f5bacfef390 | 7 | "<title>Karl's W5100 web server (ATmega644p)</title>\r\n" \ |
hggerdd | 2:8f5bacfef390 | 8 | "<h2>Karl's ATmega644p web server using Wiznet W5100 chip</h2>\r\n"; |
hggerdd | 3:79dc3337d9da | 9 | */ |
hggerdd | 2:8f5bacfef390 | 10 | |
hggerdd | 3:79dc3337d9da | 11 | const char html_head[] = "<html>\r\n<body>\r\n" \ |
hggerdd | 3:79dc3337d9da | 12 | "<title>Karl's W5100 web server (ATmega644p)</title>\r\n" \ |
hggerdd | 3:79dc3337d9da | 13 | "<h2>Karl's ATmega644p web server using Wiznet W5100 chip</h2>\r\n"; |
hggerdd | 3:79dc3337d9da | 14 | |
hggerdd | 3:79dc3337d9da | 15 | const char html_foot[] ="<br /><hr></html>\r\n"; |
hggerdd | 3:79dc3337d9da | 16 | |
hggerdd | 3:79dc3337d9da | 17 | |
hggerdd | 3:79dc3337d9da | 18 | const char c_HTTP_200_OK[] = "HTTP/1.0 200 OK\r\n"; |
hggerdd | 3:79dc3337d9da | 19 | const char c_HTTP_404_NotFound[] = "HTTP/1.0 404 Not Found\r\n"; |
hggerdd | 3:79dc3337d9da | 20 | |
hggerdd | 3:79dc3337d9da | 21 | /* Cache Control */ |
hggerdd | 3:79dc3337d9da | 22 | const char c_HTTP_CacheControl_NoCache[] = "Pragma: no-cache\r\nExpires: Fri, 01 Jan 1990 00:00:00 GMT\r\nCache-Control: no-cache, must-revalidate\r\n"; |
hggerdd | 3:79dc3337d9da | 23 | |
hggerdd | 3:79dc3337d9da | 24 | /* Content Types */ |
hggerdd | 3:79dc3337d9da | 25 | const char c_HTTP_Content_HTML[] = "Content-Type: text/html\r\n"; |
hggerdd | 3:79dc3337d9da | 26 | const char c_HTTP_Content_Javascript[] = "Content-Type: text/javascript\r\n"; |
hggerdd | 3:79dc3337d9da | 27 | const char c_HTTP_Content_Bmp[] = "Content-Type: image/bmp\r\n"; |
hggerdd | 3:79dc3337d9da | 28 | const char c_HTTP_Content_Ico[] = "Content-Type: image/ico\r\n"; |
hggerdd | 3:79dc3337d9da | 29 | const char c_HTTP_Content_Jpeg[] = "Content-Type: image/jpeg\r\n"; |
hggerdd | 3:79dc3337d9da | 30 | const char c_HTTP_Content_Gif[] = "Content-Type: image/gif\r\n"; |
hggerdd | 3:79dc3337d9da | 31 | const char c_HTTP_Content_Png[] = "Content-Type: image/png\r\n"; |
hggerdd | 3:79dc3337d9da | 32 | |
hggerdd | 3:79dc3337d9da | 33 | /* Content Length */ |
hggerdd | 3:79dc3337d9da | 34 | const char c_HTTP_Content_Length[] = "Content-Length: "; |
hggerdd | 3:79dc3337d9da | 35 | |
hggerdd | 3:79dc3337d9da | 36 | /* Empty Line */ |
hggerdd | 3:79dc3337d9da | 37 | const char c_HTTP_EmptyLine[] = "\r\n"; |
hggerdd | 3:79dc3337d9da | 38 | |
hggerdd | 3:79dc3337d9da | 39 | /* File Extensions */ |
hggerdd | 3:79dc3337d9da | 40 | const char c_HTTP_FileExtension_Htm[] = "htm"; |
hggerdd | 3:79dc3337d9da | 41 | const char c_HTTP_FileExtension_Js[] = "js"; |
hggerdd | 3:79dc3337d9da | 42 | const char c_HTTP_FileExtension_Bmp[] = "bmp"; |
hggerdd | 3:79dc3337d9da | 43 | const char c_HTTP_FileExtension_Ico[] = "ico"; |
hggerdd | 3:79dc3337d9da | 44 | const char c_HTTP_FileExtension_Jpg[] = "jpg"; |
hggerdd | 3:79dc3337d9da | 45 | const char c_HTTP_FileExtension_Gif[] = "gif"; |
hggerdd | 3:79dc3337d9da | 46 | const char c_HTTP_FileExtension_Png[] = "png"; |
hggerdd | 3:79dc3337d9da | 47 | |
hggerdd | 3:79dc3337d9da | 48 | const char c_HTTP_Page_404[] = "<html><body><div id=\"title\" style=\"width: 800px; margin: 0 auto; text-align:center\"><h1>TheUno WebServer - Error 404</h1></div><br /><div id=\"text\" style=\"width: 800px; margin: 0 auto; text-align:center\"><p>The page requested was not found. Please click <a href=\"index.htm\">this link</a> to return on the main page of the WebServer.</p></div></body></html>\r\n"; |
hggerdd | 3:79dc3337d9da | 49 | |
hggerdd | 2:8f5bacfef390 | 50 | |
hggerdd | 2:8f5bacfef390 | 51 | #endif |