in reply to Packing a URL into a URL
#!/usr/bin/perl -w use strict; use URI::Escape; use HTTP::Request; my $ru = uri_escape("http://foo.org/cgi-bin/bar.cgi?baz = qu ux;foo=di +m"); my $v=new HTTP::Request(url=>"http://foo.org/cgi-bin/bar.cgi?ru=$ru"); print $v->url, $/; =pod prints: http://foo.org/cgi-bin/bar.cgi?ru=http%3A%2F%2Ffoo.org%2Fcgi-bin%2Fbar +.cgi%3Fbaz%20%3D%20qu%20ux%3Bfoo%3Ddim call, say: $cgi->redirect( uri_unescape($cgi->param('ru')); to use the url =cut
Update: I hasten to point out the the uri_unescape() suggestion in pod is insecure if you care where the redirect goes or whether it is an url at all. Repaired a couple of pasteos.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Packing a URL into a URL
by keith (Novice) on May 29, 2002 at 03:12 UTC | |
|
Re: Re: Packing a URL into a URL
by Zaxo (Archbishop) on May 29, 2002 at 03:38 UTC | |
by Jenda (Abbot) on May 29, 2002 at 13:57 UTC |