ethernet redirect possible?

Hello,
I was just wondering if there's anyway to redirect people in a web server sketch with the ethernet shield (the one with the microSD).
For example, I would have the .jpgs I'm sharing linked at http://192.168.1.177/two.htm and depending on where the pot was turned two.htm could redirect people to different .html files.
Could anyone point me in any direction to get started with this or is it just not possible?
Thanks!

Let me check if I understand your question:

You have an arduino with a webserver. The content of the website should depend on the position of a potmeter ?

If people have loaded a page in their browser, the browser would hold the links that can be clicked on. So when a page is asked for at the arduino it must modify the page on the fly. Can be done.

See http://arduino.cc/en/Tutorial/WebServer and instead of displaying the analog values one could display something else. e.g. the name of the bitmap could be .bmp where value is the analog value.

Hi,
Thanks for your help! I have been using the WebServer example and also another example in the adafruit forums here: Arduino Ethernet shield with SD card - File hosting? - adafruit industries

what i want to do is...i have these QR codes that have web address on them...i want to make it so that depending on where the potentiometer is turned the QR code would take the person to a different place. for example, the QR code has the address http://192.168.1.177/two.htm coded into it...that can't change...and if the pot reads 0-200, for example, by scanning the QR code and clicking on the link, the web address would instead take someone to 192.168.1.177/three.htm.... or if the pot read 201-400 it would redirect to 192.168.1/four.htm.... do you know what i'm saying? the .htm files would already be written and on the sd card...i don't want to write the html with client.print() in the arduino sketch...

it's a little weird i know...thanks for any input!

You can't change the link in the QR code. but you can dynamically do a redirect - HTML tips: Redirect to a new page -

So someone asks for http://192.168.1.177/two.htm

  • The Arduino receives this GET request
  • The Arduino reads the potmeter
  • The Arduino generates a redirect repsonse
  • The arduino sends the response

makes sense?

Not weird, only very very curious for what kind of application you are going to use it.

ah yes i knew something like that existed. thanks! i'll try it out tomorrow.

i'm a painter and i'm trying to use arduinos in paintings. maybe when this project is all done i'll post it in the forums.

thanks!

Or write an article for the playground! with pictures of your paintings etc.

Another alternative would be to construct the Arduino's webpage as a frame, and return a different "frame contents" URL depending on the pot position, or whatever control you want to use.

I've used a similar technique in camera control systems: I didn't want to load down the embedded controller with serving up the entire webpage, so I had an Apache server store the frame and graphics, with the video feed and the pan/tilt/zoom info coming directly from the video server and the micro that handled the mechanics. The user's browser pulled all the pieces from the 3 systems together into a nice display, without the user realizing it wasn't a single host (except when the power to the remote camera installation went down, and the frames were filled with error messages).