如何从重定向表单操作URL中删除百分比%符号

I am facing issue, While my form action URL redirect -

<form action="https://manage.bagful.com.au/cart.php?a=add&domain=register&query='+ result.domain" id="search-form" method="POST">

Output -

https://manage.bagful.com.au/cart.php?a=add&domain=register&query=%27+%20result.domain

It's taking % percentage sign in URL, It should be as it is like form action url.

The % sign in the url is nothing else than the HTML URL Encoding https://www.w3schools.com/tags/ref_urlencode.asp

When you see the %20 or %27 you are respectively saying that there is a space or a single quote in the query parameter.

If you don't want them, you should replace the space and the single quote from your code.

Hope it helps

According to description as mentioned in above question action URL

https://manage.bagful.com.au/cart.php?a=add&domain=register&query='+ result.domain

consists of special characters and upon opening such URL in a web browser special params are encoded i.e URL encoding.

According to documentation as mentioned in w3schools website

Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format. URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.

what's wrong wiht the % sign? %27 is just what the url encoding for char ' and %20 for char "space".

You can find more here: https://www.w3schools.com/tags/ref_urlencode.asp

The real question is: are you sure that you need query='+ result.domain in the url? my guess (just a guess...) is that you are using some template engine and you want something similar to query={{ result.domain }}