HTML Arduino WebServer

Hello, I'm trying to make my Yun create a HTML page, however when I run the code, the Yun prints the HTML code as text instead of the HTML page. My code for this is

US.println("HTTP/1.1 200 OK"); //send new page
      US.println("Content-Type: text/html");
      US.println();
      
      US.println("<HTML>");
      US.println("<HEAD>");
      US.println("<TITLE>Your Title Here</TITLE>");
      US.println("</HEAD>");
      US.print("<BODY BGCOLOR=\"FFFFFF\">");
      US.println("<CENTER><IMG SRC=\"clouds.jpg\" ALIGN=\"BOTTOM\"> </CENTER>");
      US.println("<HR>");
      US.println("<a href=\"http://somegreatsite.com\">Link Name</a>");
      US.println("<H1>This is a Header</H1>");
      US.println("<H2>This is a Medium Header</H2>");
      US.println("<HR>");
      US.println("</BODY>");
      US.println("</HTML>");

where US is my client. I don't know if I need to include some sort of .h or something. Please help.

nano /www/first.html
<HTML>
<HEAD>
<TITLE>Your Title Here</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<CENTER><IMG SRC="clouds.jpg" ALIGN="BOTTOM"></CENTER>
<HR>
<a href="http://somegreatsite.com">Link Name</a>
<H1>This is a Header</H1>
<H2>This is a Medium Header</H2>
<HR>
</BODY>
</HTML>

Access web page from:

http://arduino.local/first.html

How would that be inside the arduino code? All inside client.println(); ?

davidrumsjb:
How would that be inside the arduino code? All inside client.println(); ?

No, what sonyyu tried to instruct you to do is how to use the nano text editor on the Linino side to create the html file, so not quite what you asked for.

But then it begs the question why you are trying to do this from the AVR side of the Yun in the first place... :frowning:

Ralf

Oh, I see. Well, the answer for that question is that I don't know how to do it on the Linino. Could you maybe show me some documentation? Can I handle events, like the press of a button, in the AVR if I do it from the Linino?

Thank you for your reply!

David.

Here you go, this is what I used ...

http://scuola.arduino.cc/lesson/b4EoRkV/Arduino_Yn_Intro_to_web_server