Hiawatha version: hiawatha-9.1
Operating System: 2013-02-09-wheezy-raspbian
Platform raspberry p ;-)
I have noticed that there is an old post about this question (and some obvious workarounds)
but i am posting anyway, more because this is a "Hiawatha not functioning as expected ..." rather than a bug.
maybe i have not perfectly understood the cgi mechanics of Hiawatha and maybe this is a feature instead of a bug
anyway i have noticed that command line arguments are not passed to the cgi program by Hiawatha
I have developed (under apache) several applications that rely on command line arguments and
as i am a lazy old programmer i would know if it eventually will be possible to have cmdline arg
passed to cgi ...
How to reproduce:
compile the following code and put the executable into your cgi folder as "bugtest.cgi"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc,char **argv)
{
int i;
printf("Content-Type: text/html\n\n");
printf("<html><body>\n");
printf("This program will test the data recieved on the URL using GET Requests. <br />");
printf("This program ( %s ) recieved %d arguments <br />\n", argv[0], argc);
for(i=1;i<argc;i++)
{
printf("Argument %d: %s<br />", i, argv[i]);
}
printf ("</body></html>\n");
}
invoke it: .../bugtest.cgi ?this+is+the+data
you will get
This program will test the data recieved on the URL using GET Requests.
This program ( /var/www/cgi-bin/bugtest.cgi ) recieved 1 arguments
Instead of:
This program will test the data recieved on the URL using GET Requests.
This program ( /var/www/cgi-bin/bugtest.cgi ) recieved 5 arguments
Argument 1: this
Argument 2: is
Argument 3: the
Argument 4: data