PHP Echo表单操作URL问题

时间:2019-04-26 18:17:40

标签: php

我有此代码:

echo " <form action='https://test.com/forum/index.php?/search/&q=". 
$row['record_meta_keywords'] ." 
&type=cms_records7&search_and_or=and&search_in=titles'> ";
echo " <select  name='/search/&q=". $row['record_meta_keywords'] ." 
&type=cms_records7&search_and_or=and&search_in=titles'> ";
while ($row = mysql_fetch_array($result)) {
    echo "<option value='" . $row['record_meta_keywords'] ."'>" . 
$row['record_meta_keywords'] ."</option>";
}
echo " </select> ";
echo " <br><br> ";
echo " <input type='submit'> ";
echo " </form> ";
?>

但是,当我在下拉菜单中选择一个选项时,URL显示如下:

  

https://test.com/forum/index.php?search=%26q%3DHowell+Lanes+%26type%3Dcms_records7%26search_and_or%3Dand%26search_in%3Dtitles

问题是我需要这样显示URL才能使其正常工作:

  

https://test.com/forum/index.php?/search/&q=Howell%20Lanes%20&type=cms_records7&search_and_or=and&search_in=titles

我尝试了urlencode,但这似乎也不起作用。

如何解决此问题?

0 个答案:

没有答案