1. 程式人生 > >[php] 前後端URL編解碼

[php] 前後端URL編解碼

<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <script src="jquery.min.js"></script> </head> <body> <form method="get"> <input type="text" name="search" /> <button type=
"button">搜尋</button> </form> <script> $('button').click(function() { window.location.href = 'test.php?search='+encodeURI($('input').val()); }); </script> </body> </html>