Solved

How to check Web Server is install correctly

Posted on 1997-06-23
2
223 Views
Last Modified: 2013-12-25

I have 17 years programming experience out of which 7 years in C/C++. In fact my biggest problem is some confusion. I donot know why I am not able to test CGI programs. It is just a matter of some one showing me running of CGI program.

Let me explain to you what I have done in CGI programming  and why I have failed.

* I have installed a omni HTTPd web server on my pentium machine running Win95.

* I have written the following small C program and compiled it as DOS program in BC++ 3.1

// browser.c
#include      <stdlib.h>
#include      <stdio.h>

int main(void)
{
      printf("Content-type: text/html%c%c", 10, 10);
      printf("I detect the following Web Browser: %s\n",
getenv("HTTP_USER_AGENT") );
      return(0);
}

Following is its html document

browser.htm

<html>
<head>
<title>Which Browser</title>
</head>
<body>
<h4>
<form action = "cgi-bin/browser.exe" method="post" target="main">
I can tell what Web Broser you're using<p>
Press OK to <p>
<input type="submit" value="OK">
</h4>
</body>
</html>

* OmniHTTPd server is installed in d:\httpd directory
  browser.exe is stored in d:\httpd\cgi-bin directory
  browser.htm is stored in d:\httpd\htdoc

* When I open d:\httpd\htdoc in Internet Explorer (or navigator), and click
the OK switch, the system displays "File down load dialog". Where as I expected it to tell me name of browser

* Kindly let me know whether some thing wrong with my program, its html or installation of my web server. If you think neccessary, I will send you browser.exe so that you may check it on your server and let me know.
0
Comment
Question by:email-my
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
feenix earned 50 total points
ID: 1828512
I think the problem is that if you send a request where you request an exe-file, the server _must_ send it to you. Try to use methot get instead of post, or add ? after the exe-file. Like:
<form action="cgi-bin/browser.exe?" method="POST/GET" target="main"> This should work ok.
0
 

Author Comment

by:email-my
ID: 1828513
I am not an authority to grade expert but at an outset I can say he deserves atleast GOOD grade. I having not awarded him excellent does not mean he is not excellent but probably I am not capable to do so.

I tried the following things and got result.

* In my source program, I added html tags like printf("<html>\n"), prinf("<body>\n"), then the browser line
printf("</body>\n"); printf(</html\n");

* rename browser.exe to browser.cgi

* while testing instead of opening document as d:\httpd\browser.htm I opened document as http://ipaddress/browser.htm. I worked.

* Now I have to check why Web server was not able to resolve ip address as I expected.

Note: If you expert can help me in this matter, I would really love it.

0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question