ethernet + sd + login HELP!

i'm using arduino mega+eth. shield+SD like a wbsrvr (it is the right way?) to domotics my project, i am going to creating a log in page (two account with two different logged pages with differents controls), i putted LOGIN.HTML and also the two different HTML pages in the SD.

Where i have to put the LOGIN.PHP (which connects to the database on valerioarduino.altervista.org to verify if the account or password are right) ???

if you think i'm getting wrong, please give me a solution and show me some sketches, please!

Thx in advance!

An Arduino cannot execute PHP scripts, it's clearly under-powered for such a task. If you tell us more about your project we may show you alternative ways to do it. If you need to run PHP scripts on an embedded platform buy one of the cheap embedded Linux computers (Raspberry Pi, pcDuino, Cubieboard, etc.), they have the horse power and RAM for such tasks.

maybe i've found a solutions...

i could make a site (hosted on valerioarduino.altervista.org) with these pages hosted on that server:

HOME PAGE -- presentation page with login form

(hide page, only in the root) login.php, called from login form (home page) wich redirect you in one of the following pages:

PAGE1 -- a page with a frame. the frame shows the simply html page sent from arduino (in the sd) with the NORMAL account

PAGE2 -- a page with a frame. the frame shows the simply html page sent from arduino (in the sd) with the ADMIN account

ok, the site it's not a problem but it is a possibly solution?

should i make something as an "include" in the php page wich calls on of the two pages loaded on the SD?

how can i send the pages from arduino to thw frame(arduino is connected to a public and static ip!)

thx u!

Although I would say your solution is possible it sounds horrible to me. If your login page just redirects to a standard or an admin page, you can eliminate the login completely because there's absolutely no security in this solution. Also if you host the pages on some server I don't see a reason why the Arduino has to deliver HTML pages stored on an SD card.

If you want some help, start with describing what you want to achieve not how you want to achieve it. What information does the Arduino have, that the server doesn't have?

it's only to show that the i include the db in the project (school project), if you have some alternatives please tell me!

i can, in fact, host the pages on the server but i don't know how to send to arduin the parameters to activate the pin from the web. if you can tell me how i will agree with u!

sorry for my bad english and my (really) bad ideas, thx a lot for your support!

There are at least a thousand projects on the Web about using an Arduino with an Ethernet Shield to drive some pins by a web server. You still haven't provided any useful description of what you want to achieve, so that's the only advice I can give you: use Google to find these projects.

i’ve tried a lot of projects but i haven’t found nothing that helps me.

what i want to do:

log in a log-in page and than i should be redirected on a page which controls the status (with boolean variables in arduino) and which allows me to modify the status with passing values.

i made it using arduino as a webserver, displaying the html page on the web directly from the sketch (es. client.println(<htm…) ), but i wasn’t able to integrate a log-in form in it.

i am asking to you which method do you suggest me and if u could make some example or alternatives of what i am realizing.

i need a log-in form and two different pages which controls differents pins, that’s all!

I'd suggest that you do your login stuff on the hosted web server and let the PHP scripts there access the Arduino if necessary. Do a minimal webserver sketch on the Arduino (without SD card usage) that just returns the status of whatever pin you like and accepts commands for the outputs you have to do. Then make a simple check in the sketch if the requesting IP is the IP of your webserver. This way the security is up to the scripts on the hosted server (although PHP and security excludes each other IMHO) and you can keep the sketch on the Arduino simple and reliable.

really thx to you man, it's what i'd like to do, i have only a question ?

how can i connect arduino to the site on valerioarduino.altervista.org?

arduino should be used as a client or as a server?

could you post me a topic which "talk" about this to study the code?

how can i connect arduino to the site on valerioarduino.altervista.org?

I don't know anything about your network setup. If you don't want to or are not able to change the network parameters (changing the NAT router to forward a port to the Arduino), you have to program the Arduino as a client which sends it's data as often as necessary for your application (you still didn't provide a description of what you want to achieve) to the web server and gets commands back as the response (polling). The WebClientRepeating example of the Ethernet library gives you hints then about how you're able to program that. Otherwise the WebServer example of the Ethernet library is the point to start.

I'd like to achieve, if i've understand what u wanna know, control a model of an office through a website with two different accounts with different privileges.

The model is connected with sensors and actuators to the mega board which is provided of the ethernet shield, connected directly to the internet with a public and static ip address.

Thaks for the clearance and the patience, now, i will try to set up arduino as a client which "hear" the website waiting for some parameters.

I'll try tonight, meanwhile, if you find some code on the web of what i am going to realize, please post it!

Tux for your help, man!