链接表单上的两个php页面,使用动作标签提交 [英] link two php pages on form submit with action tag

查看:59
本文介绍了链接表单上的两个php页面,使用动作标签提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过主页将表单提交时链接两个php页面,如

Hi I want to link two php pages on submition of the form through main page as

<form name="form1" method="post" action="npcc_details.php","npcc_sendmail.php">
</form>


但这不能正常工作.


But it is not working.

推荐答案

您无法以所需的方式进行操作,但是可以做的是:
只需创建一个执行npcc_sendmail.php任务的函数,然后以这种方式重写某些部分:
You cannot do it the way you want, but what you can do is :
simply create a function that does the task of npcc_sendmail.php and then re-write some part this ways:
<form name="form1" method="post" action="npcc_details.php">
</form>



在npcc_details.php中,包含文件npcc_sendmail.php函数.然后使用必需的参数调用该函数.

我想展示另一种方式,但是它没有按我预期的那样工作.它会创建一个新窗口,无论如何,请尝试上面的一个:)

好吧,第二个被添加了.简单的例子,您会了解



in npcc_details.php include the file npcc_sendmail.php function. and then call the function with required parameter.

I wanted to show another way, but it didn''t work as I expected. It creates a new window, anyway, try the above one :)

Well, the second one is added. Simple example, you would understand

<script>
	function submit_()
	{
		document.forms['you'].action="x1.php";
		document.forms['you'].target='x1_';
		document.forms['you'].submit();
		document.forms['you'].action="x2.php";
		document.forms['you'].target='x2_';
		document.forms['you'].submit();
		return false;
	}
</script>
<form name='you' action='' target=''  onsubmit='return false'>
	<INPUT TYPE='text' name='test'>
	<INPUT TYPE='SUBMIT' name='SUBMIT' onclick="return submit_()">
</form>
<iframe id='x1_' name='x1_'>
</iframe>
<iframe id='x2_' name='x2_'>
</iframe>


不可能..

您可以重定向到特定页面.
Its cant possible..

you can redirect for specific page..


这篇关于链接表单上的两个php页面,使用动作标签提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆