You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "J. Greenlees" <ja...@shaw.ca> on 2002/12/13 08:03:15 UTC
Re: [users@httpd] could we use c replace perl in cgi program?
eric lin wrote:
> Dear advanced webprogramers or linuxer:
>
> Could we using c replace perl in cgi programming?
>
> I tried a simple c program(although it not compile write)
> to parse the name and value it inherate from visitor hit the submit form
>
> ------------------------------------------------
>
> #include <stdio.h>
>
> int main()
> {
> extern char name[][];
> extern char value[][];
>
>
> printf("Content-type: text/html\n\n");
> printf("<html><body>\n");
> printf("the price fo ", name[1], " equal ", value[1], "\n");
> printf("</body></html>");
> }
>
> --------------------------------------------------------------
> like to see any of you 's opinion
yes, c can be used as cgi.
just trying to remember the module needed to add the functionality.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] could we use c replace perl in cgi program?
Posted by Chris Meadors <cl...@hereintown.net>.
eric lin wrote:
>
> not yet to security, I ((and visitors )just want to see the data they
> fill in after they hit submit botton that can be displayed in the browser,
>
> I did not know whether is because in my /etc/apache/httpd.conf I did
> not do enough load module especially with perl, so I can not catch the
> name and value of the form at first webpge they fill.
>
> looking for more hint and help
I saw your first example Perl script, and your C source. I think I know
what you want to do. Just pull all the variables submitted to the CGI
program and generate a page showing the name of the variable and it's
contents. This shouldn't be too hard in Perl (and possible, but more
difficult in C). I know you said you didn't want to have to code the
variables into your CGI program, you just wanted to know all the
parameters passed.
I'm saying you should code the parameters your program is expecting into
it. I'd think there'd be some minor security issues about just looping
through all the parameters passed. But also consider this. You have
all the different items listed. Sure, right now you just want to list
what was entered. But as your application develops you'll want to
perform different types processing each of the parameters. So you will
have to know ahead of time which ones contain what values.
I would recommend that you read up on CGI programming before you go much
farther. The Apache list and the Debian list are not places for these
kinds of questions. Just a quick Google found this site:
http://www.cgi-resources.com/ It looks like a pretty good place to
start, I'm sure you can find many other CGI resources on the Internet or
in book stores.
--
Chris
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] could we use c replace perl in cgi program?
Posted by eric lin <fs...@centurytel.net>.
J. Greenlees wrote:
> actually, I think that it's apache's suexec directive I was thinking about.
>
> if all you want is transparent url's, so that visitors don't see the
> site, that can easilt be accomplished with the scripts themselves,
> without using additional modules.
not yet to security, I ((and visitors )just want to see the data they
fill in after they hit submit botton that can be displayed in the browser,
I did not know whether is because in my /etc/apache/httpd.conf I did
not do enough load module especially with perl, so I can not catch the
name and value of the form at first webpge they fill.
looking for more hint and help
>
> you might want to read more about the scripting languages available, and
> how to use them before altering apache to hide the form action data.
>
> eric lin wrote:
>
>> Dear J. Greelees:
>>
>> Thanks your reply, some frined email me a link : cgilib
>>
>> <http://www.infodrom.org/projects/cgilib/>
>>
>> is the module you mean is in that site's cgllib?
>>
>> from that site I see paring name from form and cookie, so far I do not
>> want care cookie, just want to see the paring name and value from
>> /var/www/index.html 's form action
>>
>>
>> (probably I should add #include <cgilib.h>
>> and
>> name = cgiGetValue (cgi, "name"); /* but I have many name in my
>> index.html, to collect data from visitor, and value */
>>
>> like to see what is your opinion on that
>>
>> /* but I fail to get what expected following its Testsuite */
>> J. Greenlees wrote:
>>
>>>
>>>
>>> eric lin wrote:
>>>
>>>> Dear advanced webprogramers or linuxer:
>>>>
>>>> Could we using c replace perl in cgi programming?
>>>>
>>>> I tried a simple c program(although it not compile write)
>>>> to parse the name and value it inherate from visitor hit the submit
>>>> form
>>>>
>>>> ------------------------------------------------
>>>>
>>>> #include <stdio.h>
>>>>
>>>> int main()
>>>> {
>>>> extern char name[][];
>>>> extern char value[][];
>>>>
>>>>
>>>> printf("Content-type: text/html\n\n");
>>>> printf("<html><body>\n");
>>>> printf("the price fo ", name[1], " equal ", value[1], "\n");
>>>> printf("</body></html>");
>>>> }
>>>>
>>>> --------------------------------------------------------------
>>>> like to see any of you 's opinion
>>>
>>>
>>>
>>>
>>> yes, c can be used as cgi.
>>> just trying to remember the module needed to add the functionality.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> The official User-To-User support forum of the Apache HTTP Server
>>> Project.
>>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>> " from the digest: users-digest-unsubscribe@httpd.apache.org
>>> For additional commands, e-mail: users-help@httpd.apache.org
>>>
>>>
>>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
--
Sincere Eric
www.linuxspice.com
linux pc for sale
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] could we use c replace perl in cgi program?
Posted by "J. Greenlees" <ja...@shaw.ca>.
actually, I think that it's apache's suexec directive I was thinking about.
if all you want is transparent url's, so that visitors don't see the
site, that can easilt be accomplished with the scripts themselves,
without using additional modules.
you might want to read more about the scripting languages available, and
how to use them before altering apache to hide the form action data.
eric lin wrote:
> Dear J. Greelees:
>
> Thanks your reply, some frined email me a link : cgilib
>
> <http://www.infodrom.org/projects/cgilib/>
>
> is the module you mean is in that site's cgllib?
>
> from that site I see paring name from form and cookie, so far I do not
> want care cookie, just want to see the paring name and value from
> /var/www/index.html 's form action
>
>
> (probably I should add #include <cgilib.h>
> and
> name = cgiGetValue (cgi, "name"); /* but I have many name in my
> index.html, to collect data from visitor, and value */
>
> like to see what is your opinion on that
>
> /* but I fail to get what expected following its Testsuite */
> J. Greenlees wrote:
>
>>
>>
>> eric lin wrote:
>>
>>> Dear advanced webprogramers or linuxer:
>>>
>>> Could we using c replace perl in cgi programming?
>>>
>>> I tried a simple c program(although it not compile write)
>>> to parse the name and value it inherate from visitor hit the submit form
>>>
>>> ------------------------------------------------
>>>
>>> #include <stdio.h>
>>>
>>> int main()
>>> {
>>> extern char name[][];
>>> extern char value[][];
>>>
>>>
>>> printf("Content-type: text/html\n\n");
>>> printf("<html><body>\n");
>>> printf("the price fo ", name[1], " equal ", value[1], "\n");
>>> printf("</body></html>");
>>> }
>>>
>>> --------------------------------------------------------------
>>> like to see any of you 's opinion
>>
>>
>>
>> yes, c can be used as cgi.
>> just trying to remember the module needed to add the functionality.
>>
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server
>> Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> " from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>>
>
>
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] could we use c replace perl in cgi program?
Posted by eric lin <fs...@centurytel.net>.
Dear J. Greelees:
Thanks your reply, some frined email me a link : cgilib
<http://www.infodrom.org/projects/cgilib/>
is the module you mean is in that site's cgllib?
from that site I see paring name from form and cookie, so far I do not
want care cookie, just want to see the paring name and value from
/var/www/index.html 's form action
(probably I should add #include <cgilib.h>
and
name = cgiGetValue (cgi, "name"); /* but I have many name in my
index.html, to collect data from visitor, and value */
like to see what is your opinion on that
/* but I fail to get what expected following its Testsuite */
J. Greenlees wrote:
>
>
> eric lin wrote:
>
>> Dear advanced webprogramers or linuxer:
>>
>> Could we using c replace perl in cgi programming?
>>
>> I tried a simple c program(although it not compile write)
>> to parse the name and value it inherate from visitor hit the submit form
>>
>> ------------------------------------------------
>>
>> #include <stdio.h>
>>
>> int main()
>> {
>> extern char name[][];
>> extern char value[][];
>>
>>
>> printf("Content-type: text/html\n\n");
>> printf("<html><body>\n");
>> printf("the price fo ", name[1], " equal ", value[1], "\n");
>> printf("</body></html>");
>> }
>>
>> --------------------------------------------------------------
>> like to see any of you 's opinion
>
>
> yes, c can be used as cgi.
> just trying to remember the module needed to add the functionality.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
--
Sincere Eric
www.linuxspice.com
linux pc for sale
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org