[請益] php兩個網頁間傳值的問題

看板PHP作者 (= =)時間12年前 (2013/07/08 21:05), 編輯推噓1(102)
留言3則, 3人參與, 最新討論串1/2 (看更多)
我有兩個網頁 內容就是在第一個 使用者輸入name後 按確認後 會在第二個網頁會顯示出來 我的問題是 該如何改寫 才能在網址直接輸入 http://localhost/第二個網頁.php?name=123 就把資料直接輸出在第二個網頁 不用透過第一個網頁呢 對不起 我是新手 網頁程式碼一 <html> <head> <title>文字方塊</title> </head> <body> 輸入查詢的型號 <form method="POST" action="DataOutput.php"> <input type= "text" name = "name" size = "10"><BR> <input type="submit" value="送出"> </form> </body> </html> 網頁程式碼二 <html> <head> <title>文字方塊</title> </head> <body> <?php echo "<table border=2>"; echo "<tr>"."<td>"."輸入為:" . $_POST[name] ."</td>"."</tr>" ; // 接收文字 ; ?> <form action="DataINput.php"> <input type="submit" value="回去"> </form> </body> </html> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 180.177.13.161

07/08 21:07, , 1F
$_GET['name']
07/08 21:07, 1F

07/08 21:25, , 2F
成功了 感謝樓上大大
07/08 21:25, 2F

07/15 21:49, , 3F
如果用$_REQUEST['name']你就不用理會是post還是get了.
07/15 21:49, 3F
文章代碼(AID): #1HshagPn (PHP)
文章代碼(AID): #1HshagPn (PHP)