一种形式,一种按钮,两种动作? [英] One form, one button, two actions?

查看:192
本文介绍了一种形式,一种按钮,两种动作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面orderbelow.php,它有一个表单,上面有一个按钮Order Now。

表单被提交给send-order.php向网站所有者发送电子邮件。 send-order.php上的脚本还会将用户引导至新页面completeyourorder.php。



completeyourorder.php上有一个表单,其中包含一个操作按钮发送用户到贝宝完成付款。

是否有可能在第一个表单orderbelow.php有一个按钮发送电子邮件给所有者,并发送用户支付宝?



这会在当前进程中删除一个步骤。



谢谢

解决方案

您可以发送电子邮件给所有者而无需刷新页面:这应该使用AJAX完成(简单Javascript请求发送的花哨名称^ ^)。

您也可以在第一个PHP脚本中添加位置标题,以自动重定向到第二个PHP脚本:这应该使用PHP中的函数标题完成。

I have a page orderbelow.php which has a form on it with one button "Order Now".

The form is submitted to send-order.php which sends an email to the website owner. The script on send-order.php also directs the user to a new page completeyourorder.php.

There is a form on completeyourorder.php with a button that has the action of sending the user to paypal to complete the payment.

Is it possible to have one button on the first form orderbelow.php that sends the email to the owner, and sends the user to paypal?

This will remove one step in the current process.

Thanks

解决方案

You can either send a email to the owner without refreshing the page: this should be done with AJAX (fancy name for simple Javascript requests sending ^^).

You can also add a location header in your first PHP script to automatically redirect to the second PHP script: this should be done with the function header in PHP.

这篇关于一种形式,一种按钮,两种动作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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