显示一个html文件 [英] display a html file
问题描述
我有一个html文件包含一个表单,要求用户选择一个选项并按Enter键将数据传递给服务器。
在服务器那里,我有一个cgi脚本(C语言)接受来自浏览器的输入,然后将html页面输出到浏览器。
浏览器应该打开页面,但它没有,而是提示我保存文件(我在表单方法中请求的.cgi文件)....
怎么回事?
i想要显示脚本输出的html文件浏览器,而不是保存该文件。
这是我的脚本:
这是一个HTML问题吗?看起来更像是一个C问题我将把这个帖子复制到那个论坛。
这是一个HTML问题吗?看起来更像是一个C问题我将把这个帖子复制到那个论坛。
我不确定我应该在这里或在C subforum中发帖,因为我不确定我的问题涉及哪一方,也许两者都因为它关于HTTP响应,因为无法输出我在脚本中动态生成的html文件。
感谢您的帮助。
Nicky Eng
< blockquote>你的代码/服务器需要输出浏览器的标题。
编辑:我看到你正在输出它。获取Firefox扩展名TamperData或HTTPSomething(忘记确切名称),以便查看实际发送/接收的内容。
I have a html file contains a form asking user to select a choice and press enter to pass the data to server.
In server there, i have a cgi script(C language) that accepts the input from browser and then output a html page to browser.
The browser should open the page, but it didn''t, instead, it prompt me to save the file(.cgi file i requested in form method)....
how that happens?
i want to display the html file that the script output to browser, not to save that file.
here is my script:
Is this an HTML question? Looks more like a C question I will copy this thread to that forum.
Is this an HTML question? Looks more like a C question I will copy this thread to that forum.i''m not sure i should post here or in C subforum, because i''m not sure my question involves which side, maybe both because its about HTTP reponse since cannot output the html file i generated dynamically in the script.
thanks for the help.
Nicky Eng
Your code/server needs to output the header for the browser.
EDIT: I see you are outputting it properly. Get the Firefox extension TamperData or HTTPSomething(forgot the exact name) so you can view what is actually sent/received.
这篇关于显示一个html文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!