Thread overview | |||||
---|---|---|---|---|---|
|
June 27, 2003 server variables? | ||||
---|---|---|---|---|
| ||||
Hi, I'm trying to write some CGI stuff in D. All I've done so far is a simple "Hello world" program. What I need to know is how to get the server variables. request_uri, remote_addr and all of those. Help is appreciated. /MÃ¥rten |
June 27, 2003 Re: server variables? | ||||
---|---|---|---|---|
| ||||
Posted in reply to majbritt37 | majbritt37@hotmail.com wrote: > I'm trying to write some CGI stuff in D. All I've done so far is a simple "Hello > world" program. What I need to know is how to get the server variables. > request_uri, remote_addr and all of those. Help is appreciated. The CGI specification is here: http://hoohoo.ncsa.uiuc.edu/cgi/interface.html CGI stores various variables in the environment. You can retrieve them using getenv, such as with: private struct crt { static extern (C) char* getenv (char* varname); } char[] getenv (char[] varname) { return toString (crt.getenv (toStringz (varname))); } If you're feeling up to it, a CGI library would be a valuable contribution to the community because of the many obscure elements about the interface. The Python module for it is documented here (http://www.python.org/doc/current/lib/module-cgi.html); I've never used it, so I don't know how good it would be, but it might be helpful for reference. |
July 02, 2003 Re: server variables? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Burton Radons | "Burton Radons" <loth@users.sourceforge.net> wrote in message news:bdii03$1oii$1@digitaldaemon.com... > If you're feeling up to it, a CGI library would be a valuable contribution to the community because of the many obscure elements about the interface. Yes. The new Phobos uri routines are a good start. |
Copyright © 1999-2021 by the D Language Foundation