On Wed, Dec 16, 2009 at 1:32 PM, Rogan Creswick <[email protected]> wrote:
> On Mon, Dec 14, 2009 at 2:02 PM, Neal <[email protected]> wrote:
>> On Sun, Dec 13, 2009 at 7:31 PM, Joe Pruett <[email protected]> wrote:
>>>>> i think what you want is:
>>>>> Reg1: <input type="text" name="reg1" value="deadbeef"><br/>
>>>>>
>>>>> which makes an input box prefilled with deadbeef.
>>>>>
>>>>> of course with a cgi you would get the real value to put there.
>>>>
>>>> Yes. Exactly. Precisely. But what does _that_ look like?  It's been
>
> In my (limited) experience with CGI, the CGI part has all boiled down
> to printing out valid html to some output stream.  Some of my initial
> apps just did this sort of thing:
>
> print("<html>\n");
> ....
> print("</html>");
>
> Obviously, there are macros to help with all that, and frameworks that
> obviate the need for extensive use of macros everywhere... but, if
> we're assuming no javascript, then any dynamic content needs to be
> generated with the entire page, so:
>
> print("<input type=\"text\" name=\"reg1\" value=\"" . getReg1Value() .
> "\"><br/>");
>
> (where '.' is string concatenation)
>
> Whatever language you're using probably has an API for generating
> input fields that should be used instead of pure printing, but from my
> meager understanding, that's essentially what you need to do.
>
> After writing that out, I have suspect I've interpreted your question
> wrong though....  If you need to have the field update in response to
> user activity without reloading the page, then you need some form of
> javascript, or you *do* need to reload the page, inserting the updated
> values (faking the AJAX part).  In the later case, you'd need to pass
> the parameters necessary to determine the next state in via the user's
> request that is generated based on whatever action they took... eg:
> say the user clicks on a button to display register 2's content.  Then
> you would need to provide that information either as part of the url
> or as part of the payload (eg: in a POST request).  Via url, you could
> just append a query parameter to the url, eg: "?regId=2" and then use
> that variable in the cgi to generate the proper output, showing the
> content of register 2 instead of 1.  (Once again, there are probably
> APIs to help with this too, but they will be specific to your language
> and framework choice.)
>
> Anyway, I hope I'm not off the mark :)

Yes, that's pretty much where my quest ended.

The answer to my original question, which Joe got in one, was You
Can't Do That (i.e. call a CGI script from within HTML directly for
the initial text box contents). Need at least javascript.

Aaron Burt wrote:
> You want to run a CGI on an 8051?  Cool!  I still can't believe what folks
> do with those little buggers.

I don't know about want, but it's what the Silicon Labs eval board and
demo software had going on. Looked like it would work, if you don't
mind paying $$$$ for the full Keil compiler package. The folks I was
doing it for didn't have the dough so I wasted a month of my time for
nuttin'.

The WIZnet W7100 looks like the best of their old TCP/IP controller +
MAC + PHY with an 8051 along with 64K RAM and 64K flash thrown in for
good measure. If I had to do it again that's where I'd start. Or if I
really wanted another family of uC maybe the W5100 to offload the
TCP/IP stack and network goodies. Currently less than $7 / $5
respectively on their website (www.ewiznet.com).

Disclaimer: I haven't bought or used any of their stuff yet, but the
articles in Circuit Cellar look intriguing.

NealS
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to