[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Accessing QUERY during a form POST

From: Stephen F. Booth
Subject: RE: Accessing QUERY during a form POST
Date: Wed, 7 Mar 2001 23:54:09 -0600

Cgicc will parse the strings for you.  You need to use the accessor methods
on the Cgicc class.  IE,

form_iterator name = cgi.getElement("name");

Look at the sample CGIs or the info files for more info.  There is a brief
tutorial that I think will help you out.


Each element of data entered by the user is parsed into a FormEntry. A
FormEntry contains methods for accessing data as strings, integers, and
doubles. In the hypothetical form mentioned above, a user would enter their
name, age, and sex. Regardless of the type of value, the data is accessed
via FormEntry2. You obtain FormEntry objects via Cgicc's getElement methods,
all of which return typedefs of standard-library iterators:

form_iterator name = cgi.getElement("name");

If the item is not found, the iterator will refer to an invalid element, and
should not be dereferenced using operator* or operator->. Cgicc provides
methods for determining whether an iterator refers to a valid element:

if(name != cgi.getElements().end()) {
   // iterator refers to a valid element

> I have already tried both getPostData() and getQueryString() but
> that returns the unparsed string. How do I go about parsing that
> information once I have it in a string? I was hoping that the
> Cgicc class could do that for me.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]