473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

error in c program for cgi ng.html

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 -
Feb 10 '06 #1
3 1603
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

Feb 10 '06 #2
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).

Feb 10 '06 #3
Thanks David - and all who mentioned the 2 \n's. They solved the error.

Hul

David Dorward <do*****@gmail.com> wrote:
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).


Feb 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Victor | last post by:
I'm trying to run this java program, but somehow the program always quit w/o giving any error msg at all. it happenned inside the first case statements. Strangely, after printing happen2, it just...
38
by: Red Dragon | last post by:
I am self study C student. I got stuck in the program below on quadratic equation and will be most grateful if someone could help me to unravel the mystery. Why does the computer refuse to execute...
4
by: jf li | last post by:
I have a Asp.net web application and a Asp.net Web service application. The Web application is using HtmlInputFile to get a 50M size of file selected by end user, read the data of this file and...
0
by: Herman Jones | last post by:
I'm getting the following error when I build a Class Library project: Embedding manifest... Project : error PRJ0002 : Error result 1 returned from 'C:\WINDOWS\system32\cmd.exe'. It happens with...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
4
by: kalaisuresh | last post by:
hai, in my program i used the DBI module my program running well in terminal(redhat linux 9.0) if i use the same program in interface (use CGI) that time it shows the log error BEGIN...
0
by: RCM | last post by:
I am really eager to quit the Microsoft world and get into LAMP. For the immediate future I can't do the Apache part, so I am at least trying to get PHP up and running under IIS to learn it. I...
0
by: SYT | last post by:
Hello, I wrote C program for connecting to postgresSQL server to retrieve data from the postgres database. The program is: #include <stdio.h> #include <stdlib.h> #include "libpq-fe.h" int...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.