[英]How to add a function to a form
我有这样的形式:
$form = '<form action="https://www.zarinpal.com/users/pay_invoice/'.$res.'"
method="post" target="_parent" ><input type="submit" value="Buy"/></form>';
$form .= '</form>';
echo $form;
我想向此表单添加一个函数,因此,当单击“购买”时,然后在MySQL中为该用户创建一个数据库,其中包含所选项目的信息以及其帐户ID(具有待处理的交易状态),然后该表单重定向他到包含的网页。
我可以管理MySQL部分,但是该表单仅将用户重定向到给定的网页,并且不能将用户信息添加到数据库中。
有没有一种方法可以为该用户添加数据库行,然后将其重定向到付款网页? (除了创建另一个页面)
<form action="https://www.zarinpal.com/users/pay_invoice/<?=$res ?> method="post" target="_parent" >
<input type="test" name="customer-name" />
<input type="submit" value="Buy"/>
</form>
然后在目标页面上输入:
<?
print_r($_POST);
## That will let you know what is being posted from the form
?>
例如,要访问“客户名称”变量,请执行以下操作:
$customerName = $_POST["customer-name"];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.