如何使用 PHP 提交表单?
<form style="text-align:center;" id="paypalform" action="https://www.paypal.com/cgi-bin/webscr" method="POST">
<input type='hidden' name='cmd' value='_xclick'>
<input type='hidden' name='business' value='[email protected]'>
<input type='hidden' name='item_name' value='201001114262121'>
<input type='hidden' name='amount' id="amount" value='1.00'>
<input type='hidden' name='currency_code' value='CAD'>
<input type='hidden' name='return' value='http://www.xxx.com/paypal_process.php'>
<input type='hidden' name='invoice' value='82'>
<input type='hidden' name='charset' value='utf-8'>
<input type='hidden' name='no_shipping' value='1'>
<input type='hidden' name='no_note' value=''>
<input type='hidden' name='notify_url' value='http://www.xxx.com/return.php'>
<input type='hidden' name='rm' value='82'>
<input type='hidden' name='cancel_return' value='http://www.xxx.com/index.html'>
</form>
有人知道吗?
<form style="text-align:center;" id="paypalform" action="https://www.paypal.com/cgi-bin/webscr" method="POST">
<input type='hidden' name='cmd' value='_xclick'>
<input type='hidden' name='business' value='[email protected]'>
<input type='hidden' name='item_name' value='201001114262121'>
<input type='hidden' name='amount' id="amount" value='1.00'>
<input type='hidden' name='currency_code' value='CAD'>
<input type='hidden' name='return' value='http://www.xxx.com/paypal_process.php'>
<input type='hidden' name='invoice' value='82'>
<input type='hidden' name='charset' value='utf-8'>
<input type='hidden' name='no_shipping' value='1'>
<input type='hidden' name='no_note' value=''>
<input type='hidden' name='notify_url' value='http://www.xxx.com/return.php'>
<input type='hidden' name='rm' value='82'>
<input type='hidden' name='cancel_return' value='http://www.xxx.com/index.html'>
</form>
Anyone knows?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
试试这个
Try this
如果您希望在页面加载后立即提交此表单,并且您决定使用 PHP 提交表单,则可以将其添加到页面底部:
但这似乎还有很长的路要走。你可以将 javascript 写入页面...也许我不确定你想要做什么,但我想我会把它扔掉。
If you're wanting this form to submit as soon as the page is loaded, you can add this to the bottom of the page if you're determined in using PHP to submit the form:
But that seems like a long way around it. You could just write the javascript into the page... maybe I'm not sure what you're wanting to do, but I thought I'd throw this out.
使用 javascript,您可以在 PHP 代码中提交表单,如下所示:
(技巧在最后一行)
如果有人有好主意请分享。
Using javascript you can submit the form inside PHP code like this:
(trick is in last line )
If someone has a good idea pls share.
您可以使用 fsubmit PHP 库从 php 提交 HTML 表单 https://github.com/randomsymbols/fsubmit
You can submit an HTML form from php with fsubmit PHP library https://github.com/randomsymbols/fsubmit
您可以使用 cURL 或此库(基于 cURL 和简单的 html dom)从 PHP 脚本提交 HTML 表单。
You can submit an HTML form from a PHP script with cURL or this library (that is based on cURL and simple html dom).