At 11:37 09.07.2003 -0700, you wrote:
>I was wondering if PHP or a similar language could be compiled to work on=
=20
>the Ethernut system? I was just wondering because of the success of=20
>Adam's webserver that survived a Slashdotting. I figured that you could=20
>build in a simple scripting langauge into one of these units.
That's an idea that I had a few months ago when I made the ethernet module=
=20
for the C64. I just started to learn PHP, and it very much reminded me of=20
Basic (I learned Basic on ZX81 and C64). Now, since there's already a Basic=
=20
interpreter in the C64, I thought it would be an easy thing to call the=20
interpreter out of Contiki to run simple programs that generate dynamic web=
=20
pages.
Everyone on the C64 knows about Simon's Basic, a Basic extension for=20
graphics and easy game programming. How about Adam's Basic for easy=20
web-scripting? You could think of an implementation of the IO stream as an=
=20
already-opened channel for the Basic. Let's assume channel#5 is the web=20
channel, something like this would be pretty self-explaining:
10 INPUT#5,A$:REM this comes from the HTTP line
20 PRINT#5,"<html>"
30 PRINT#5,"<head>"
40 PRINT#5,"<meta http-equiv=3D"Content-Type" content=3D"text/html;=20
charset=3Diso-8859-1">"
50 PRINT#5,"<title>Dynamic web page demo</title>"
60 PRINT#5,"</head>"
70 IF A$=3D"magicword1" THEN GOSUB magicnumber1
80 IF A$=3D"magicword2" THEN GOSUB magicnumber2
90 PRINT#5,"</html>"
100 END
[plus the magicnumber routines here]
..how about it?
ciao,
--=20
Jens Sch=F6nfeld
|