You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by eric lin <fs...@centurytel.net> on 2002/12/14 10:58:37 UTC
[users@httpd] Re: could we use c replace perl in cgi program?
David Z Maze wrote:
> eric lin <fs...@centurytel.net> writes:
>
>>Dear advanced webprogramers or linuxer:
>>
>> Could we using c replace perl in cgi programming?
>
>
> Sure, nothing's intrinsically tied to Perl at all. Look at
> http://hoohoo.ncsa.uiuc.edu/cgi/overview.html for the CGI
> specification, including a listing of the environment variables that
> could be set.
>
>
>>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>");
>>}
>>
>>--------------------------------------------------------------
>
>
> Well, sure, where do you expect name and value to actually be defined?
> (I don't think 'extern' is allowed to modify local variables in any
> case.) You also might look for C CGI libraries if this would make you
> happy; there seems to be a libcgicg1-dev package in unstable, which
> appears to provide the right functionality.
may be after I install what you recommand's libcgicg1-dev package
it have test-cgi in my /usr/lib/cgi-bin/ so I change my
/var/www/index.html's form point to it
<form method="POST" action="http://www.linuxspice.com//cgi-bin/test-cgi">
after I use my browser to hit the submit bottom, it show Forbidden
You don't have permission to access //cgi-bin/test-cgi on this server.
Apache/1.3.26 Server at default.itsyourdomain.com Port 80
even I chmod 777 test-cgi
need advancer's advice
>
--
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