Re: [Libcgi-general] Fetching all parameters
Brought to you by:
rafaelsteil
From: Rafael S. <ra...@in...> - 2004-05-18 13:19:09
|
cgi_process_form() returns a *formvars type, as you can see in the source or in the documentation. You could use this type to loop by all elements. Another way, using sessions, is in the "session" example. Rafael Bill Moseley wrote: >I need to covert all the form parameters into a new query string -- but >I do not know the names of the form variables. > >My quick look at the API doesn't show a method for this -- seems like I >need to specify the name. What does cgi_process_form() return? Would >that provide me with that info? > >I need a simple click-through script -- where GET or POST parameters are >read and built into a new query string and then a redirect is sent. One >of the passed in parameters is the URL of the redirect location. > >For example, I might have a form: > ><FORM method=GET action="http://localhost/redirect.cgi"> > <input type="hidden" name="__redirect" value="http://google.com"> > <INPUT TYPE=hidden name=num value=50> > <INPUT TYPE=hidden name=hl value=en> > <INPUT TYPE=hidden name=safe value=off> > <INPUT TYPE="text" NAME="q" VALUE="" SIZE="30" MAXLENGTH="256"> > <INPUT TYPE="submit" VALUE="Go"> ></FORM> > >That would generate a redirect with a Location: of: > > http://google.com?num=50&hl=en&save=off&q=query > >The point, of course, is to log the click-throughs on external links. > > >By the way -- there seems to be a number of C cgi libraries around. >Anyone know how they compare? > >Thanks > > > > > > > |