0

我有这样的表格:

$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 部分,但表单只会将用户重定向到给定的网页,我无法将用户信息添加到数据库中。

有没有办法可以为这个用户添加一个数据库行,然后将他重定向到支付网页?(创建另一个页面除外)

4

1 回答 1

0
<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"];
于 2013-04-10T17:10:30.217 回答