很抱歉我英语不好。。。我想把数据发送到一个url,出于安全考虑,我想知道如何在不使用栏地址的情况下"加载"。类似这样的东西:
<form action="???.php">
<input name="customer" id="customer"> </ input>
<input name="amount" id="amount"> <input>
<input type="submit" value="send"> <input>
</ form>
https://www.mysite.com/transfer.php?username=myusername&password=mypassword&to=客户&数量=10
点击"发送"按钮,我会加载页面,将10从我的帐户(我的用户名)转移到客户帐户。在地址栏中,因为密码出现在url中。Ps:密码不会被加密感谢
<form action="pageToPostTo.php" method="post">
现在,如果单击"发送",url中没有变量,但您可以使用$_POST["customer"]
和$_POST["amount"]
在pageToPostTo.php中读取它们
祝好运
试试这个
<form action="yourfile.php" method="POST">
<input name="customer" id="customer"> </ input>
<input name="amount" id="amount"> </input>
<input type="submit" value="send"> </input>
</ form>
所有数据将被传递到另一个页面,而不显示在URL中。
首先,您可以使用POST方法提交表单,而不是使用默认的GET。
你这样做:
<form action="???.php"method="POST"><input name="client"id="customer"><input name="amount"id="amount"><input type="submit"value="send"><表单>这将允许您在PHP中使用
$customer = $_POST['customer']
而不是$_GET['customer']
。这样,表单值在URL中就不可见了。
如果您真的想放弃地址栏,可以使用cURL或Ajax提交表单(请注意,使用Firebug等工具仍然可以看到Ajax请求)。