簡體   English   中英

PHP POST變量使用帶有get變量的鏈接

[英]PHP POST variables using link with get variable

我想使用以下網址示例發布變量:

<form method="POST" action="index.php?p=1">
    <input id="mail" type="text" size="50" placeholder="E-Mail" />
    <input id="password" type="password" size="50" placeholder="Password" />
    <button type="submit">Login</button>
</form>

通過鏈接中的p-Variable,我的網站確定應顯示哪個默認網站。

我的問題是在默認站點的$ _POST數組中沒有可用數據。

$ _POST-data是否僅可用於下一個調用的腳本?

還是我做錯了什么?

您需要命名輸入。 例如name="mail"

<form method="POST" action="index.php?p=1">
    <input name="mail" id="mail" type="text" size="50" placeholder="E-Mail" />

然后,您將訪問$_GET['p']$_POST['mail']

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM