You want to use urlencode()
, right?
Why does the requested address need json_encode
...
And when outputting, it must be enclosed in quotation marks
<code class="javascript">$.post('<?=$_SERVER["REQUEST_URI"]?>', ...);</code>
The default submission event of the form is triggered. After the click event you added is triggered, you need to prevent the form from being submitted by default and return false