in reply to Re: Passing value with two words or more
in thread Passing value with two words or more

Three thoughts here.

First, Juerd is right - you need to properly quote the text contained in $name, and one way to do that is to use URI::Escape.

Second, for this specific issue, you could get away with simply surrounding $name in the redirect with double quotes, like this:

print $query->redirect("http://webserver/action.asp?name=\"$name\"" +); OR print $query->redirect(qq!http://webserver/action.asp?name="$name"! +);
Third, also as Juerd pointed out, and since you've already "use"d CGI, you could use the CGI 'escape' and 'unescape' functions. Read about those either in Lincoln Stein's book 'Official Guide to Programming With CGI.pm' p.199, or by reading the perldocs on the CGI.pm module by doing
perldoc CGI
at a command prompt.

HTH.

Replies are listed 'Best First'.
Re: Re: Re: Passing value with two words or more
by Juerd (Abbot) on Mar 11, 2004 at 15:12 UTC

    you could get away with simply surrounding $name in the redirect with double quotes

    Care to explain to me why it would then no longer be two words? I can't imagine that this really works. (And if it does, I'd guess it'd be for MSIE only)

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Re: Re: Re: Passing value with two words or more
by Anonymous Monk on Mar 11, 2004 at 17:08 UTC
    Thanks all. I tried the escape quotes and it didnt work. I am trying to use the URI::Escape but not sure how to use it. My browser (Netscape 4.77) is the only one that seems to have the problem. The script works with two words when I use IE 5.5 and Netscape 7 but not with Netscape 4.77.