Hi, I read tutorials on cgi.... cant find that much help. I have a question.
I am working with a dragonball mc68k processor running uClinux. I will be installing the BOA webserver on this board. The board will control some lights. Either lights on or lights off. Now I want to put control in a web site so I can connect to the web site anywhere and turn on my house lights via web page. I have the C program written that will control the lights.
I want to do the following very simple form.
Code:
<FORM ACTION="URL">
<INPUT TYPE="radio" NAME="state" VALUE="Y">LightsON<BR>
<INPUT TYPE="radio" NAME="state" VALUE="N">LightsOFF<BR>
<INPUT TYPE="submit" NAME="button" VALUE="Send">
</FORM>
So when some one selects lights on, it will execute a cgi script that will call a c program that turns on a light.( the web server will be hosted on a NETdimm processor, the processor is connected to a light and the c program controls the light(on/off).
I want to implement this in a web site, so when a user goes to the web site they use the form on the website and select on or off in the form for lights.
So Do I write a shell script that calls the C program? or a shell script that calls a cgi script which inturn calls my C lights program
Code:
#!/bin/sh
eval "`cgi script here? or my C lights program? $*`"
#what else do I need in this shell script.?
cat - << \END
echo Content-type: text/plain
echo
echo done.
I am confused? I dont know how to write cgi scripts, do I need one to process user input to my very simple form(on/off) or all I need is a shell script that calls my C lights program?
any guidance will be helpfull