Form value and Url encoding in Vortex

rluan
Posts: 29
Joined: Mon Jul 23, 2001 1:22 pm

Form value and Url encoding in Vortex

Post by rluan »

Hi,

I need to send a string with spaces in between (e.g. "the string to pass") through a form with 'get' method. I first used "%U" to Url-encode this string before I put it into <input type=hidden ...> statement. It seems to be fine when it comes out in the Url, but when I retrieve this string again, the retreived string have "+" signs in the place of empty spaces. Use the "the string to pass" example, it becomes "the+string+to+pass". Is it possible to just return the original string with spaces rather than "+" signs? Any help is highly appreciated. Thanks.
User avatar
John
Site Admin
Posts: 2623
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH

Form value and Url encoding in Vortex

Post by John »

You shouldn't need %U in that case, just

<input type=hidden name="var" value="$var">

which should produce the HTML:

<input type=hidden name="var" value="the string to pass">

The quotes around $var are important to keep the value together. You would use %U if generating a URL, as the url should be:

....?var=the+string+to+pass

and then $var will get the value "the string to pass".
John Turnbull
Thunderstone Software
rluan
Posts: 29
Joined: Mon Jul 23, 2001 1:22 pm

Form value and Url encoding in Vortex

Post by rluan »

I added the variable name to <$vars = ...> and it works well !! Thanks for help.