vantastic
01-24-2012, 08:35 PM
Hello
I'm trying to figure out a way to encode url's that contain spaces. Normally I'd manually type %20 as needed, however what I'm doing is part of a form that creates a thread. Allow me to explain.
A user fills out a form with their country, the form is submitted and the variable is pulled for the country to show the flag. The code is something like this:
http://test.com/images/flags/{qo_01}.png
If the country is more than one word then problems start to happen. The resulting output code is something like this.
[img]http://test.com/images/flags/United States
Notice its all broken because it auto-parses the url and breaks at the first space character. Actually it's a lot worse at the beginning it will include actual HTML for the bbcode, but for demonstrative purposes, this is the part that concerns me.
It should be:
[img]http://test.com/images/flags/United%20States.png
The variable {qo_01} needs to have any spaces substituted with the %20 characters.
I know how to do this in php, but is there some inline <vb: xx> function that can help? I've thought about BBCode for it too, but haven't tried anything.
Thanks in advance!
Van
I'm trying to figure out a way to encode url's that contain spaces. Normally I'd manually type %20 as needed, however what I'm doing is part of a form that creates a thread. Allow me to explain.
A user fills out a form with their country, the form is submitted and the variable is pulled for the country to show the flag. The code is something like this:
http://test.com/images/flags/{qo_01}.png
If the country is more than one word then problems start to happen. The resulting output code is something like this.
[img]http://test.com/images/flags/United States
Notice its all broken because it auto-parses the url and breaks at the first space character. Actually it's a lot worse at the beginning it will include actual HTML for the bbcode, but for demonstrative purposes, this is the part that concerns me.
It should be:
[img]http://test.com/images/flags/United%20States.png
The variable {qo_01} needs to have any spaces substituted with the %20 characters.
I know how to do this in php, but is there some inline <vb: xx> function that can help? I've thought about BBCode for it too, but haven't tried anything.
Thanks in advance!
Van