Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP回送表单操作URL问题_Php - Fatal编程技术网

PHP回送表单操作URL问题

PHP回送表单操作URL问题,php,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_met

我有以下代码:

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> ";
?>
echo”“;
回声“;
while($row=mysql\u fetch\u数组($result)){
“回声”。
$row['record_meta_keywords']。“”;
}
回声“;
回声“

”; 回声“; 回声“; ?>
但是,当我在下拉列表中选择一个选项时,URL显示如下:

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

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


我如何解决这个问题

该代码无法生成该输出。您的PHP特别包含字符串
index.PHP?/search/
,该字符串未显示在输出中。您需要使用
htmlspecialchars
进行输出,您需要使用
http\u build\u query
生成查询字符串,如果您希望代码可读,你不需要把HTML和PHP混合得太厉害。somoene能帮我写代码吗?我的PHP技能没有那么先进。我尝试过使用htmlspecialchars,但没有成功。该代码无法生成该输出。您的PHP特别包含字符串
index.PHP?/search/
,该字符串未显示在输出中。您需要使用
htmlspecialchars
进行输出,您需要使用
http\u build\u query
生成查询字符串,如果您希望代码可读,你不需要把HTML和PHP混合得太厉害。somoene能帮我写代码吗?我的PHP技能没有那么先进。我试着使用htmlspecialchars,但没有成功。