Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > CGI Programming in C on Xitami Web Server

Reply
Thread Tools

CGI Programming in C on Xitami Web Server

 
 
Don Blow, Jr.
Guest
Posts: n/a
 
      06-28-2004
I am running the simple program shown below (written in c):

-----------------------------------------------------------------------

#include <stdio.h>
#include <stdlib.h>



int main(int argc, char *argv[])
{
printf("Content-Type: text/html\n\n");


printf("<HTML><HEAD><TITLE>CGI Output</TITLE></HEAD>\n");
printf("<BODY>\n");
printf("<H1>Hello, world.</H1>\n");
printf("</BODY></HTML>\n");

return 0;
}

-----------------------------------------------------------------------

When I compile this program and run it on a webpage through the Xitami
server

I get a blank page. When I run it in a DOS command prompt window I get the
following:

-----------------------------------------------------------------------

Content-Type: text/html



<HTML><HEAD><TITLE>CGI Output</TITLE></HEAD>
<BODY>
<H1>Hello, world.</H1>
</BODY></HTML>



C:\Xitami\cgi-bin>
C:\Xitami\cgi-bin>
C:\Xitami\cgi-bin>

-----------------------------------------------------------------------

This looks right to me. I have used the xitami server with CGI before and it
gave

me no problems, but now all I get is a blank page when I run any cgi
program. I don't

know if it is my programming syntax or a config issue or what. Has anyone
had this

problem before too and can anyone identify what the issue here is?



 
Reply With Quote
 
 
 
 
Arthur J. O'Dwyer
Guest
Posts: n/a
 
      06-29-2004

On Mon, 28 Jun 2004, Don Blow, Jr. wrote:
>
> I am running the simple program shown below (written in c):


There is nothing wrong with your C program. Thus your problem
is off-topic here. (Your *post* was perfectly on-topic, but now
that we've established that your C is correct, you'll have to
look elsewhere for answers to your real problem.)

<OT> The HTTP and HTML look good to me, too, at a first glance.
I think you probably have a configuration problem; read the Xitami
docs and check Google. </OT>

-Arthur

 
Reply With Quote
 
 
 
 
kal
Guest
Posts: n/a
 
      06-29-2004
"Arthur J. O'Dwyer" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...

> <OT> The HTTP and HTML look good to me, too, at a first glance.
> I think you probably have a configuration problem; read the Xitami
> docs and check Google. </OT>


Content-Type: text/html
<HTML><HEAD><TITLE>CGI Output</TITLE></HEAD>
<BODY>
<H1>Hello, world.</H1>
</BODY></HTML>

That "Content-Type: text/html" line seems out of place to me.
 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      06-29-2004
kal wrote:
>
> "Arthur J. O'Dwyer" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
>
> > <OT> The HTTP and HTML look good to me, too, at a first glance.
> > I think you probably have a configuration problem; read the Xitami
> > docs and check Google. </OT>

>
> Content-Type: text/html
> <HTML><HEAD><TITLE>CGI Output</TITLE></HEAD>
> <BODY>
> <H1>Hello, world.</H1>
> </BODY></HTML>
>
> That "Content-Type: text/html" line seems out of place to me.


Why is that?




Brian Rodenborn
 
Reply With Quote
 
Arthur J. O'Dwyer
Guest
Posts: n/a
 
      06-30-2004

On Tue, 29 Jun 2004, Default User wrote:
>
> kal wrote:
> >
> > "Arthur J. O'Dwyer" <(E-Mail Removed)> wrote
> > > <OT> The HTTP and HTML look good to me, too, at a first glance.
> > > I think you probably have a configuration problem; read the Xitami
> > > docs and check Google. </OT>

> >
> > Content-Type: text/html
> > <HTML><HEAD><TITLE>CGI Output</TITLE></HEAD>

[...]
> > That "Content-Type: text/html" line seems out of place to me.

>
> Why is that?


Because here in comp.lang.c, we don't discuss Content-Type headers.
Thus, it (and any further discussion of HTTP and related protocols)
is out of place here.

-Arthur,
less baitfully
 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      06-30-2004
"Arthur J. O'Dwyer" wrote:
>
> On Tue, 29 Jun 2004, Default User wrote:
> >
> > kal wrote:
> > >
> > > "Arthur J. O'Dwyer" <(E-Mail Removed)> wrote
> > > > <OT> The HTTP and HTML look good to me, too, at a first glance.
> > > > I think you probably have a configuration problem; read the Xitami
> > > > docs and check Google. </OT>
> > >
> > > Content-Type: text/html
> > > <HTML><HEAD><TITLE>CGI Output</TITLE></HEAD>

> [...]
> > > That "Content-Type: text/html" line seems out of place to me.

> >
> > Why is that?

>
> Because here in comp.lang.c, we don't discuss Content-Type headers.
> Thus, it (and any further discussion of HTTP and related protocols)
> is out of place here.



I didn't say anything about CGI protocols. From looking at the code, the
line seemed to be in the right place, although I'd expect another new
line following it. But it definitely did not look out of place.



Brian Rodenborn
 
Reply With Quote
 
Arthur J. O'Dwyer
Guest
Posts: n/a
 
      06-30-2004

On Wed, 30 Jun 2004, Default User wrote:
>
> "Arthur J. O'Dwyer" wrote:
> > On Tue, 29 Jun 2004, Default User wrote:
> > > kal wrote:
> > > > "Arthur J. O'Dwyer" <(E-Mail Removed)> wrote
> > > > > <OT> The HTTP and HTML look good to me, too, at a first glance.
> > > >
> > > > Content-Type: text/html

> > [...]
> > > > That "Content-Type: text/html" line seems out of place to me.
> > >
> > > Why is that?

> >
> > Because here in comp.lang.c, we don't discuss Content-Type headers.
> > Thus, it (and any further discussion of HTTP and related protocols)
> > is out of place here.

>
> I didn't say anything about CGI protocols. From looking at the code, the
> line seemed to be in the right place, although I'd expect another new
> line following it. But it definitely did not look out of place.


*sigh* "The HTTP and HTML look good to me." That means THEY ARE
FINE; kal is wrong; this whole discussion is not topical here; I
explained *all* this in my original post; the OP has gone to look for
configuration answers elsewhere. Posting to comp.lang.c saying, "gee,
this HTTP looks right to me" is useless. If you think it's *not* right,
then find a tutorial and read it --- not here! If you think it *is*
right, then be quiet, because you won't add anything with "me-too"
posts.

HTH,
-Arthur
 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      06-30-2004
"Arthur J. O'Dwyer" wrote:
>
> On Wed, 30 Jun 2004, Default User wrote:
> >
> > "Arthur J. O'Dwyer" wrote:
> > > On Tue, 29 Jun 2004, Default User wrote:
> > > > kal wrote:
> > > > > "Arthur J. O'Dwyer" <(E-Mail Removed)> wrote
> > > > > > <OT> The HTTP and HTML look good to me, too, at a first glance.
> > > > >
> > > > > Content-Type: text/html
> > > [...]
> > > > > That "Content-Type: text/html" line seems out of place to me.
> > > >
> > > > Why is that?
> > >
> > > Because here in comp.lang.c, we don't discuss Content-Type headers.
> > > Thus, it (and any further discussion of HTTP and related protocols)
> > > is out of place here.

> >
> > I didn't say anything about CGI protocols. From looking at the code, the
> > line seemed to be in the right place, although I'd expect another new
> > line following it. But it definitely did not look out of place.

>
> *sigh* "The HTTP and HTML look good to me." That means THEY ARE
> FINE; kal is wrong; this whole discussion is not topical here; I
> explained *all* this in my original post; the OP has gone to look for
> configuration answers elsewhere. Posting to comp.lang.c saying, "gee,
> this HTTP looks right to me" is useless. If you think it's *not* right,
> then find a tutorial and read it --- not here! If you think it *is*
> right, then be quiet, because you won't add anything with "me-too"
> posts.



I DIDN'T POST THAT! Go reread, and reread for comprehension.

Please confine your comments to what I a actually said, not what others
said and that you have mistakenly attributed to me. I posted a one-line
question in reference to the comment:

"That "Content-Type: text/html" line seems out of place to me."


Feel free to apologize for your rude behavior.



Brian Rodenborn
 
Reply With Quote
 
Arthur J. O'Dwyer
Guest
Posts: n/a
 
      07-01-2004

On Wed, 30 Jun 2004, Default User wrote:
>
> "Arthur J. O'Dwyer" wrote:
> > On Wed, 30 Jun 2004, Default User wrote:
> > > "Arthur J. O'Dwyer" wrote:
> > > > On Tue, 29 Jun 2004, Default User wrote:
> > > > > kal wrote:
> > > > > > "Arthur J. O'Dwyer" <(E-Mail Removed)> wrote
> > > > > > > <OT> The HTTP and HTML look good to me, too, at a first glance.
> > > > > >
> > > > > > Content-Type: text/html
> > > > [...]
> > > > > > That "Content-Type: text/html" line seems out of place to me.
> > > > >
> > > > > Why is that?
> > > >
> > > > Because here in comp.lang.c, we don't discuss Content-Type headers.
> > > > Thus, it (and any further discussion of HTTP and related protocols)
> > > > is out of place here.
> > >
> > > I didn't say anything about CGI protocols. From looking at the code, the
> > > line seemed to be in the right place, although I'd expect another new
> > > line following it. But it definitely did not look out of place.

> >
> > *sigh* "The HTTP and HTML look good to me." That means THEY ARE
> > FINE; kal is wrong; this whole discussion is not topical here; I
> > explained *all* this in my original post; the OP has gone to look for
> > configuration answers elsewhere. Posting to comp.lang.c saying, "gee,
> > this HTTP looks right to me" is useless. If you think it's *not* right,
> > then find a tutorial and read it --- not here! If you think it *is*
> > right, then be quiet, because you won't add anything with "me-too"
> > posts.

>
> I DIDN'T POST THAT! Go reread, and reread for comprehension.
>
> Please confine your comments to what I a actually said, not what others
> said and that you have mistakenly attributed to me. I posted a one-line
> question in reference to the comment:
>
> "That "Content-Type: text/html" line seems out of place to me."
>
> Feel free to apologize for your rude behavior.


Well, I apologize if I misinterpreted your comment, but here's what
I saw:

* The OP posts a query about C and HTTP.
* I answer the C part, and point out that the HTTP part is also fine.
* kal says, "That 'Content-Type: ...' line seems out of place..."
* You (Brian) say, "Why is that?", which I gather to mean you either
honestly don't know HTTP and want to start a conversation about
it in comp.lang.c, or else you know kal is wrong and are just
yanking his/her chain.
* I respond, tongue-in-cheek, that the line is out-of-place because
here in comp.lang.c we do not discuss HTTP, and further discussion
ought to be taken elsewhere (as I'd already said, three messages
upthread).
* You respond, seemingly with a straight face, that you *still*
don't see anything wrong with the HTTP, and imply that you still
want to keep talking about HTTP in comp.lang.c.
* I reply to you, explaining the joke, and explaining *explicitly*
that HTTP is not and has never been topical here. I acknowledge
that maybe you know HTTP, in which case you have nothing to worry
about, or maybe you don't, in which case you should read a tutorial
if you're interested.
* You take offense, apparently because you think *I* think you were
the OP (or maybe kal, I'm not sure). You seem to know that HTTP
is not topical here.
[So stop trying to talk about it.]

It ought to satisfy you that I say kal was wrong, the OP and I were
right. If not, you're welcome to read a book on your own. I'm going
back to C programming now.

-Arthur,
signing off
 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      07-01-2004
"Arthur J. O'Dwyer" wrote:
> Well, I apologize if I misinterpreted your comment, but here's what
> I saw:
>
> * The OP posts a query about C and HTTP.


Ok.

> * I answer the C part, and point out that the HTTP part is also fine.
> * kal says, "That 'Content-Type: ...' line seems out of place..."


Yes.

> * You (Brian) say, "Why is that?", which I gather to mean you either
> honestly don't know HTTP and want to start a conversation about
> it in comp.lang.c, or else you know kal is wrong and are just
> yanking his/her chain.


You're saying my commentary was vague. Fair enough. There was obviously
a third explanation, I could have been yanking his chain in an on-topic
manner. "Out of place" can have multiple meanings, one being "doesn't
belong" another being "in the wrong location". The output as a result of
the perfectly topical C program shown, looked good excepting the other
newline I expected, but of course the standard has nothing to say about
what an implementation must do with a newline. That's a QOI issue.

> * I respond, tongue-in-cheek, that the line is out-of-place because
> here in comp.lang.c we do not discuss HTTP, and further discussion
> ought to be taken elsewhere (as I'd already said, three messages
> upthread).


Well, I didn't get much tongue-in-cheek from it.

> * You respond, seemingly with a straight face, that you *still*
> don't see anything wrong with the HTTP, and imply that you still
> want to keep talking about HTTP in comp.lang.c.


I didn't comment on the HTTP. I commented on the text output, it could
have been "Mary Had a Little Lamb" for all I cared. This was my
objection, you assigning things to me that I didn't say.

> * I reply to you, explaining the joke, and explaining *explicitly*
> that HTTP is not and has never been topical here. I acknowledge
> that maybe you know HTTP, in which case you have nothing to worry
> about, or maybe you don't, in which case you should read a tutorial
> if you're interested.


Whether I know HTTP or CGI or anything else is beside the point, as I
already told you, because I wasn't commenting on it.

> * You take offense, apparently because you think *I* think you were
> the OP (or maybe kal, I'm not sure). You seem to know that HTTP
> is not topical here.


Why am I supposed to get your jokes when you don't get mine? I explained
mine to you as well.

> It ought to satisfy you that I say kal was wrong, the OP and I were
> right. If not, you're welcome to read a book on your own. I'm going
> back to C programming now.


I haven't the slightest care (in this newsgroup) whether that was a
proper response header or not. I care about the output from the program.


I hope you understand now that what annoyed me was you claiming (and did
it again in this post) that I said things I didn't. Read carefully what
exactly I said at each point.




Brian Rodenborn
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 3.25 Where can I learn about CGI or Web programming in Perl? PerlFAQ Server Perl Misc 0 03-31-2011 10:00 PM
Recommendation for a small web framework like Perl's CGI::Applicationto run as CGI? excord80 Python 17 01-29-2009 06:02 PM
what's wrong calling a Perl/CGI script in Perl/CGI script under Tomcat server? kath Perl Misc 4 04-09-2007 09:21 PM
lrwp + xitami John Bradbury Python 0 11-02-2004 09:55 AM
CGI Problems With Xitami Fuzzyman Python 7 04-14-2004 08:01 AM



Advertisments