Hi all. I have been playing with a basic page coming from my arduino which I have been using to switch things on and off. I would ideally like to have at least one other page for some settings, so I would like to be able to click a link from the main page that the arduino serves up to then display a second one?

//simple button GET server code to control servo and arduino pin 5//for use with IDE 1.0//open serial monitor to see what the arduino receives//use the \ slash to escape the " in the html//for use with W5100 based ethernet shields//Powering a servo from the arduino usually DOES NOT WORK.//note that the below bug fix may be required//http://www.instructables.com/id/Control-an-LED-over-the-internet-using-the-Arduino/step2/Connected/// http://code.google.com/p/arduino/issues/detail?id=605//http://www.instructables.com/id/Arduino-Control-via-a-Web-Service-with-Teleduino/?ALLSTEPS

Then, I'd suggest that this is not the project for you. Understanding client/server architecture, understanding what the client requested, and knowing how to define a page to be served are all things you must understand BEFORE you begin trying to substitute an Arduino as the server.

Quote

I't just confused how I could code the html to point to a new page and the arduino to interpret the request - then serve a different page?

You should spend some time at http://www.w3schools.com/default.asp then. There is nothing different about having the Arduino server a web page with a link to another page and having any other server serve a page with a link.

Understanding what happens when you click that link will be necessary before you can serve that other page.

I understand basic HTML, usually you have to put HMTL files on a webserver, then you can simply request them by pointing to them as I'm sure you are well aware.

However I'm not sure how this would work from an arduino. I guess the first page that gets served is the same as index.html or default.html - If I add a link to display in the page served by the arduino, where do I point it?

Also how do I define the page titles? From what I can see in the code that I'm using there is nothing to define that it should be titled index or default.html?

I understand basic HTML, usually you have to put HMTL files on a webserver, then you can simply request them by pointing to them as I'm sure you are well aware.

I'm well aware of what happens when you click a hyperlink. It is you that is making assumptions, incorrectly, about the "magic" that happens.

You don't request a page by simply pointing to it. The browser has no idea what you are pointing to. You have to actually click the text rendered as a hyperlink. When you do that, a lot of things happen, some on the client end and some on the server end. In order to server the correct page, the server must actually parse the GET request. You aren't even printing what the client is asking for. How you can then presume to supply a response is really beyond me.

Quote

However I'm not sure how this would work from an arduino.

Then, you do NOT understand what the browser is doing, or what the Arduino is being asked to do. Learning what the Arduino is being asked to do is easy. Once you know that, you should be able to serve different pages, and predict what the request will be when the user interacts with the page you do serve. Once you can do that, then serving the correct page in response to the GET request is trivial.

Quote

Also how do I define the page titles?

What do you mean by "the page titles"? There is a html tag, title, but I don't think that is what you are asking about.

How does the arduino know which html to send once it receives a request? In the example code I'm using all of the HTML gets sent to the browser. I'd like to have a second chunk of html that is sent.

Sorry I wasn't clear about page titles I mean't default pages in root directories on the web are called index or default.html, I'm just confused how one would structure code to put placed under another title, for example a page called data.html.

I'm still at a loss as to how all this could be organised into a secondary page. I will try and do some more research, thanks for the help so far

//zoomkat 12-8-11//simple button GET with iframe code//for use with IDE 1.0//open serial monitor to see what the arduino receives//use the \ slash to escape the " in the html (or use ')//address will look like http://192.168.1.102:84 when submited//for use with W5100 based ethernet shields