Apache服务器+ CGI [英] Apache Servers + cgi's
问题描述
我正在使用Apache服务器,并且编写了CGI吐出HTML页面,基本上(现在)返回了提交的参数.
我在LocalHost上使用它来了解这些东西的工作原理.
页面也被打印到文件.
尝试启动CGI时,出现以下错误.:
I am using an Apache Server and I wrote a CGI to spit out a HTML Page, basically (for now)returning the submitted parameters.
I am using it on the LocalHost in order to get a feel of how these things work.
The page is also printed to File.
When trying to fire the CGI, I get the Following Error.:
[Mon Aug 09 23:34:58 2010] [error] [client 127.0.0.1] malformed header from script. Bad header=<HTML>: EchoHtm.cgi, referer: http://localhost/
但是,服务器和浏览器都可以完全接受打印的页面.
例如:
However, the printed page is perfectly acceptable to both the server and the browser.
example:
<pre>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Softguard\EchoHtm.cgi">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Default</TITLE>
</HEAD>
<BODY>
<TABLE border="1">
<tr>
<th width="25%">Parameter</th>
<th width="55%">Value</th>
</tr>
<tr>
<td width="25%">AccNr<br></td>
<td width="55%">12345<br></td>
</tr>
<tr>
<td width="25%">UserId<br></td>
<td width="55%">abcde<br></td>
</tr>
</TABLE>
</BODY>
</HTML>
有什么我想念的吗?
该页面由以下HTML文件调用:
Is there something I am Missing ?
The Page is Called by the Following HTML File:
<pre>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Developer Studio">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Softguard Sales and Support</TITLE>
</HEAD>
<BODY>
<center>
<H1>Welcome to Softguard</H1><br>
<Form Action="cgi-bin/EchoHtm.cgi" Method="GET" >
<H2>Please enter your Account Number and User ID</H2><br>
<Table Border=0 Cellspacing =20 width=400 height=20>
<TR><TD><P>Account Number</td><td><input type="text" Name="AccNr" size=48>
</td></tr>
<TR><TD><P>User ID</td><td><input type="text" Name="UserId" size=48>
</td></tr>
</Table>
<input type="submit" Value="Submit">
<input type="Reset" Value="Reset">
</Form>
</BODY>
</HTML>
这是Apache配置问题,还是cgi生成的页面,应该在标头中包含一些额外的魔咒.
问候
Bram van Kampen
Is this an Apache Configuration Issue, or, is a page generated by a cgi supposed to have some extra magic incantations in the header.
Regards
Bram van Kampen
推荐答案
布拉姆.我在此处 [ 干杯,
彼得
Hi Bram. I found some useful stuff here[^] See particularly the section headed "Writing a CGI program". It tells you exactly what to start with. As a member of the Apache users mailing list, I''d recommend you join it if you are going to do anything significant with Apache. [I host 3 sites here, and manage another on the other side of the planet.] Also the Apache online docs are good if you read carefully. [The mailing list shows up those that can''t! ;P ]
Cheers,
Peter
这篇关于Apache服务器+ CGI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!