看板 PHP 關於我們 聯絡資訊
請問 假設我的test.html想要傳變數給test.php 我試了兩種傳法 <form method=get action=test.php> <input type=hidden name=input1 value=部落> <button type=submit>xxx</button> <a class=index href=test.php?input2=部落>部落</a> </form> 一個是用button傳 一個用hyperlink傳 我去echo $input1 出現"部落" echo $input2 出現"??落" 我看網址列button會變成 test.php?input1=%E9%83%A8%E8%90%BD hyperlink會變成 test.php?input2=部落 為什麼hyperlink的傳法有問題? 我用的編碼是utf-8 請教大家要怎麼解決才會讓hyperlink的用法不會出錯 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.228.55.238 ※ 編輯: duidae 來自: 61.228.55.238 (12/21 02:43)
Kej:<a href="test.php?input2=<?=urlencode('部落')?>"> 12/21 10:43
duidae:非常感謝~~ 12/21 20:10