Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
CGI Problem. Help!!!
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Maverick  
View profile  
 More options Sep 27 2006, 7:50 pm
Newsgroups: comp.infosystems.www.authoring.cgi
From: "Maverick" <vellanki.chan...@gmail.com>
Date: Wed, 27 Sep 2006 17:50:40 CST
Local: Wed, Sep 27 2006 7:50 pm
Subject: CGI Problem. Help!!!
Hi All,

 I am new to CGI, I thought you people might be able to help me:

My HTML code:
--------
<HTML>
<HEAD>
<TITLE> CGI Multiplication Example </TITLE>
</HEAD>
<FORM ACTION="http://localhost/cgi-bin/mult.cgi" METHOD="GET">
<P> Please specify the multiplicands </P>
<INPUT name="m" SIZE="5">
<INPUT NAME="n" SIZE="5"><BR>
<INPUT type="SUBMIT" value="Multiply!">
</FORM>
<BODY>
</BODY>
</HTML>
--------

My C CGI Script code:
--------
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
            char *data;
            long m,n;
            printf("Content-type: text/html\n\n");
            printf("<TITLE> Multiplication results </TITLE>\n");
            printf("<H2>Mutliplication results</H2>\n");
            data = getenv("QUERY_STRING");
            if(*data == ' ')
                        printf("<P>ERROR</P>");
            else
            if(scanf(data,"m=%1d&n=%1d",&m,&n)!=2)
                        printf("<P>ERROR</P>");
            else
                        printf("The product of %1d and %1d is
%1d",m,n,m*n);
            return 0;

}

-----------

Now when I run my HTML, it is giving Internal Server Error, I am using
Apache Web Server below is error message that I have found in Error log
file:

----------
[Tue Sep 26 20:39:42 2006] [error] [client 127.0.0.1] (OS 5)Access is
denied.  : couldn't create child process: 720005: MULT.cgi
[Tue Sep 26 20:39:42 2006] [error] [client 127.0.0.1] (OS 5)Access is
denied.  : couldn't spawn child process: C:/Program Files/Apache
Software Foundation/Apache2.2/cgi-bin/MULT.cgi
----------

Please let me know where I am doing wrong!!

Thanks,
Chandra.

--
PLEASE NOTE: comp.infosystems.www.authoring.cgi is a
SELF-MODERATED newsgroup. aa.net and boutell.com are
NOT the originators of the articles and are NOT responsible
for their content.

HOW TO POST to comp.infosystems.www.authoring.cgi:
http://www.thinkspot.net/ciwac/howtopost.html


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sherm Pendley  
View profile  
 More options Sep 28 2006, 12:01 am
Newsgroups: comp.infosystems.www.authoring.cgi
From: Sherm Pendley <spamt...@dot-app.org>
Date: Wed, 27 Sep 2006 22:01:23 CST
Local: Thurs, Sep 28 2006 12:01 am
Subject: Re: CGI Problem. Help!!!

That's invalid HTML. Forms go inside the body element. That's *a* problem,
and you'll certainly want to fix that, but it's obviously not *the* problem
since your CGI appears to be getting called.

> My C CGI Script code:

Writing CGIs in C is what drove me to Perl. :-)

I don't see any immediate problem with it, although there's no reason you
should be parsing the form input for yourself. That can be a bit tricky in
places, and there are libraries to do it for you.

One of the better ones:

    http://www.boutell.com/cgic/

> Now when I run my HTML

Nit-Pick: You can't run HTML. It's markup, not programming.

>, it is giving Internal Server Error, I am using
> Apache Web Server below is error message that I have found in Error log
> file:

> ----------
> [Tue Sep 26 20:39:42 2006] [error] [client 127.0.0.1] (OS 5)Access is
> denied.  : couldn't create child process: 720005: MULT.cgi
> [Tue Sep 26 20:39:42 2006] [error] [client 127.0.0.1] (OS 5)Access is
> denied.  : couldn't spawn child process: C:/Program Files/Apache
> Software Foundation/Apache2.2/cgi-bin/MULT.cgi
> ----------

> Please let me know where I am doing wrong!!

Try giving your CGI an .exe extension. It's in /cgi-bin, so it shouldn't
need a .cgi extension for Apache to execute it as a CGI, and Windows may
not want to run it with a .cgi extension.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net

--
PLEASE NOTE: comp.infosystems.www.authoring.cgi is a
SELF-MODERATED newsgroup. aa.net and boutell.com are
NOT the originators of the articles and are NOT responsible
for their content.

HOW TO POST to comp.infosystems.www.authoring.cgi:
http://www.thinkspot.net/ciwac/howtopost.html


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »