Send help-cgicc mailing list submissions to
address@hidden
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.gnu.org/mailman/listinfo/help-cgicc
or, via email, send a message with subject or body 'help' to
address@hidden
You can reach the person managing the list at
address@hidden
When replying, please edit your Subject line so it is more specific
than "Re: Contents of help-cgicc digest..."
Today's Topics:
1. problems with forms submitted via http POST
(address@hidden)
----------------------------------------------------------------------
Message: 1
Date: Sat, 29 Jul 2006 15:54:22 +0200
From: address@hidden
Subject: [help-cgicc] problems with forms submitted via http POST
To: address@hidden
Message-ID: <address@hidden>
Content-Type: text/plain; charset=ISO-8859-1
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
------------------------------
_______________________________________________
help-cgicc mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-cgicc
End of help-cgicc Digest, Vol 34, Issue 2
*****************************************