如何:向PHP提交表单而不返回? [英] HOW TO: Submit a form to PHP with no return?
问题描述
如何:向PHP提交表单而不返回?
我需要提交一个表单,用于将文件上传到PHP脚本但不需要
返回任何内容。
表格的目标应该像空设备一样。
我使用JavaScript函数提交表单。
有没有办法做到这一点?
gsb
HOW TO: Submit a form to PHP with no return?
I need to submit a form for file upload to a PHP script but do not want
anything returned.
That is the TARGET for the form should be like a null device.
I am using a JavaScript function to submit the form.
Is there a way to do this?
gsb
推荐答案
gsb写道:
如何:将表单提交给PHP而不返回?
我需要提交一个表单以便将文件上传到PHP脚本但不希望
返回的任何东西。
这个表格的目标应该像一个空设备。
我使用JavaScript函数提交表单。
有没有办法这样做?
HOW TO: Submit a form to PHP with no return?
I need to submit a form for file upload to a PHP script but do not want
anything returned.
That is the TARGET for the form should be like a null device.
I am using a JavaScript function to submit the form.
Is there a way to do this?
< form method =" post" action =" null.php">
<! - ... - >
和
>
<?php // null.php
//处理文件上传
// *没有*输出到浏览器
//然后......
// ...
// ...
退出(0);
?>
这是为了什么?
-
如果每个人都阅读,USENET会是一个更好的地方::邮件地址:
http://www.catb.org/~esr/faqs/smart-questions.html :适用于:
http://www.netmeister.org/news/learn2quote2.html :" text / plain" :
http://www.expita.com/nomime.html:到10K字节:
<form method="post" action="null.php">
<!-- ... -->
and
<?php // null.php
// deal with file upload
// *with no* output to the browser
// and then ...
// ...
// ...
exit(0);
?>
What is this for?
--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Pedro Graca,
感谢您的快速回复。
但是,它似乎不起作用。
目标默认为self,浏览器窗口只是空白。
这是我得到的:
<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.0 Transitional // EN">
< HTML>< HEAD>
< META http-equiv = Content-Type content =" text / html;
charset = windows-1252">< / HEAD>
< BODY>< / BODY>< / HTML>
这是一个没有反馈的简单上传页面。
...但是我无法安静。
gsb
Pedro Graca,
Thanks for a quick reply.
However, it does not seem to work.
The target defaults to self and the browser window simply goes blank.
Here is what I get back:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
It is for a simple upload page without feedback.
....but I can not make it quiet.
gsb
gsb写道:
Pedro Graca ,
感谢您的快速回复。
但是,我t似乎不起作用。
目标默认为self,浏览器窗口空白。
以下是我的回复:
<!DOCTYPE HTML PUBLIC" ; - // W3C // DTD HTML 4.0 Transitional // EN">
< HTML>< HEAD>
< META http-equiv = Content-Type content =" text / html ;
charset = windows-1252">< / HEAD>
< BODY>< / BODY>< / HTML>
我明白了。
试试这个:
<?php
//处理上传
header(''Content-Type:text / plain; charset = us-ascii'');
echo''' ';
?>
这是一个没有反馈的简单上传页面。
...但我不能让它安静。
Pedro Graca,
Thanks for a quick reply.
However, it does not seem to work.
The target defaults to self and the browser window simply goes blank.
Here is what I get back:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
I see.
Try this:
<?php
// deal with upload
header(''Content-Type: text/plain; charset=us-ascii'');
echo '''';
?>
It is for a simple upload page without feedback.
...but I can not make it quiet.
为什么?
为什么没有反馈?
甚至不是很简单
感谢您上传文件whatever.zip
现在关闭浏览器并阅读书籍:-)
-
如果每个人都阅读,USENET会是一个更好的地方:邮件地址:
http://www.catb.org/~esr/faqs/smart-questions.html :适用于:
http://www.netmeister.org/news/learn2quote2.html :text /纯" :
http://www.expita.com/nomime.html:到10K字节:
Why?
Why no feedback?
Not even a simple
Thank you for uploading the file whatever.zip
Now close your browser and go read a book :-)
--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
这篇关于如何:向PHP提交表单而不返回?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!