Q&A > CGI programming
Description:I have a script that will construct a link to another PERL script and pass it parameters based on a column returned by a query.
There is a problem however. This column that I am passing as a parameter may or may not have spaces in it. More than likely it will have spaces.
So my question is: how do I detect this spaces and replace them with the appropiate ASCII character code.
As an alternative, how do I filter the user input when providing values for this column so that it will eliminate the spaces, if any?
Thanks in advance
|Answer: When constructing a URL from script variables, how do I handle spaces properly?|
contributed by merlyn
In fact, if you are trying to construct
You'll run into a lot of problems if $marine is not URI-encoded. So the first step is to trot over to URI::Escape and run it through there. No spaces will be left!
Please (register and) log in if you wish to add an answer
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr