The action you want is called "URL encoding".
Any information beyond
the URL filename
and internal document #
anchor following the filename which can then be followed by ?formname=...
and one more obscurity that is generally only found in specialist web servers http call syntax method to screen unique server platform idiosynchratic commands
appended to a url
must be URL encoded.
In php with normal web server operation variables returned by php are automatically URL decoded.