You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Randy Terbush <ra...@zyzzyva.com> on 1996/05/17 19:13:32 UTC
Re: data types in CGI
>
> > I'm working on some module code that is doing quite a bit of
> > forms generation. One thing that I am finding very frustrating
> > about working in C with the CGI interface is the conversion of
> > everything to and from string types.
> >
> > Is it a ludicrous consideration to possibly extend the CGI
> > spec to allow preservation of integer types? Is there something
> > I'm missing?
>
> Probably. It'd need CGI variables to be passed by clients with
> type information.
>
> e.g. (int)age=10&(char)name=foo
>
> because Apache wouldn't know if something was meant to be a string or
> an integer, and guessing is a bad idea....
>
> least_favourite_film=10&favourtite_film=jaws
To make things backword compatible, it would be logical to treat
everything as a string as it has been. However, for things that
were explictly typed as int (possibly with a DTYPE attribute), it
could be passed as something like: (obviously an error in your example)
least_favourite_film==10&favourtite_film=jaws
^^
> What ya' gonna do with "10" ?
>
> Now if you use perl.............
That's the problem... I have been using perl for some time and
have gotten a bit spoiled. Now I have a need to do it in C.