PHP Echo Form Action URL Issue

I have this code:

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> ";
?>

When I choose an option from the dropdown (in this case Garden City Lanes), it sends me to this URL which is incorrect:

https://test.com/forum/index.php?%2Fsearch%2F%26q%3D+ %26type%3Dcms_records7%26search_and_or%3Dand%26search_in%3Dtitles=Garden+City+Lanes

I need it to send me to this correct URL:

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

My PHP skills are not that advanced so I’m not sure how to fix this issue. Can anyone please help?

and what’s the value of $row['record_meta_keywords']? Have a look at it with var_dump().

The code itself works, it’s the a href that doesn’t work, it’s not going to the correct URL as stated in the original question.
The value of $row[‘record_meta_keywords’] are the bowling alleys in the table it’s calling form.

Anyone can help with this?

Sponsor our Newsletter | Privacy Policy | Terms of Service