Click here to get back home

error in c program for cgi ng.html

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
error in c program for cgi ng.html Hul Tytus 02-10-2006
Posted by Hul Tytus on February 10, 2006, 10:22 am
Please log in for more thread options


comp.infosystems.www.authoring.html
error in c program for cgi

When compiled and placed in the cgi directory, the code below generates a
server (netbsd/apache) error. The directory & mintst.cgi permissions are
u=rwx g=x o=rx and have, if memory serves, been used previously with
success.

Any suggestions regarding the cause of error are most welcome.

Hul

---c code
int main()        /* mintst.c */
{
        printf("Content-type: text/html\n");
        printf("<html>\n");
        printf("<head><title>Title of mintst.c</title></head>\n");
        printf("<body>\n");
        printf("<tt>\n");
        printf("<pre>\n");

        printf("MINTST is complete\n");

        printf("</pre>\n");
        printf("</tt>\n");
        printf("</body>\n");
        printf("</html>\n");
        exit(0);
}

---html code that links/calls mintst.cgi
see mintest <a href="http://www.panix.com/~ht/pcgi/mintst.cgi">[mintest]</a>


--
- for email, put the word "keeper" in the subject line -

Posted by Steve Pugh on February 10, 2006, 10:44 am
Please log in for more thread options


Hul Tytus wrote:

>         printf("<tt>\n");
>         printf("<pre>\n");
>
>         printf("MINTST is complete\n");
>
>         printf("</pre>\n");
>         printf("</tt>\n");

<tt> is an inline element and hence can not contain a block level
element. like <pre>. Switch the nesting of these two elements.

The rest of the your problem has nothing to do with HTML. I'd suggest a
CGI or a C authoring group instead.

Steve


Posted by David Dorward on February 10, 2006, 11:09 am
Please log in for more thread options


Hul Tytus wrote:
> int main()        /* mintst.c */
> {
>         printf("Content-type: text/html\n");
>         printf("<html>\n");

You need a blank line between the HTTP header and the HTML document.
(You also appear to be missing the Doctype).


Posted by Hul Tytus on February 10, 2006, 11:46 am
Please log in for more thread options


Thanks David - and all who mentioned the 2 \n's. They solved the error.

Hul

> Hul Tytus wrote:
> > int main() /* mintst.c */
> > {
> > printf("Content-type: text/html\n");
> > printf("<html>\n");

> You need a blank line between the HTTP header and the HTML document.
> (You also appear to be missing the Doctype).


Similar ThreadsPosted
How do I run the MS Windows file search program from html August 22, 2006, 2:46 pm
what program cleans up Microsoft Office "HTML" crap December 28, 2006, 2:19 am
Error when validating HTML pages May 2, 2005, 7:28 pm
Error al abrir excel file en html January 23, 2006, 10:01 am
Parsing error in Amaya HTML Editor January 28, 2008, 12:56 pm
W3C HTML Validator Error - Invalid content-type November 13, 2004, 1:48 am
W3C Validator error?
is valid for doctype HTML 4.01 Strict
April 21, 2005, 12:46 pm
W3C validator error isn't really an error? September 13, 2005, 1:21 am
css program February 16, 2005, 10:57 pm
New Sitemap Program June 20, 2005, 8:47 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap