help-cgicc
[Top][All Lists]
Advanced

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

[help-cgicc] problems with forms submitted via http POST


From: juju4ml934685
Subject: [help-cgicc] problems with forms submitted via http POST
Date: Sat, 29 Jul 2006 15:54:22 +0200
User-agent: Thunderbird 1.5.0.4 (X11/20060516)

Hi,

my cgi program and a tutorial cgicc program both crash when
called with the http "POST" method and with some ?key=value
added to the url.

The program crash is in the call to isEmpty() in a context like here:
//-------------------------------
form_iterator fvalue1 = formData.getElement("value1");
if( !fvalue1->isEmpty() && fvalue1 != (*formData).end())
{
cout << "Value1: " << **fvalue1 << endl;
}
//-------------------------------

this problem only shows when all of the 3 following conditions concur:
a) the cgi program receives data via the POST method
b) the url has key/value pairs added as in the GET method
c) there's a call to FormEntry::isEmpty() or FormEntry::length

- if instead of a) i use http GET, then it works fine, and i can even
use code
like the above to retrieve the http get vars.
- if instead of b) there are no GET-type vars at the end of the url, a
POST request
is processed just fine. However, it seems that any cgi program used with
http post
shows this problem if the user just adds ?somekey=somevalue to the url.
- if instead of c) i don't use FormEntry, it works fine even if i use
post with ?key=value
added to the url. i could even parse these manually from the query
string (where they
do get transferred).

if you want to reproduce this problem, just compile the example code from
http://yolinux.com/TUTORIALS/LinuxTutorialC++CGI.html
and call it with "POST" method AND adding any ?key=value to the url.

is this a bug or  did i overlook something?

Cheers,
Juju




reply via email to

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