Home > Archive > PERL Beginners > March 2007 > how to pass double quotes in a url from CGI script
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
how to pass double quotes in a url from CGI script
|
|
| Ravi Malghan 2007-03-29, 9:58 pm |
| Hi: I am having trouble passing double quotes when passing a url string. Everything after the double quotes does not go through. For example in the perl script below, the browser ends up going to http://appserver/arsys/forms/rearsp...Help+Desk/Defau
lt+User+View/?&qual='TRS%20Ticket%20Number'=
--------SCRIPT----------
$url = "http://appserver/arsys/forms/rearsp01/HPD%3AHelp+Desk/Default+User+View/?&qual='TRS%20Ticket%20Number'=\"1406746\"";
<HTML>
<HEAD>
<TITLE>Redirect to my Trouble Ticket</TITLE>
</HEAD>
$url = "http://appserver/arsys/forms/rearsp01/HPD%3AHelp+Desk/Default+User+View/?&qual='TRS%20Ticket%20Number'=\"1406746\"";
print '<META HTTP-EQUIV="refresh" content="1;URL=$url">';
</HTML>
-----------------------------------
How do I pass double quotes so the browser goes to http://appserver/arsys/forms/rearsp...er+View/?&qual='TRS%20Ticket%20Number'="1406746" ?
Thanks
Ravi
________________________________________
________________________________________
____
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097
| |
| Yitzle 2007-03-29, 9:58 pm |
| > $url = "http://...=\"1406746\"";
> print '<META HTTP-EQUIV="refresh" content="1;URL=$url">';
Plugging in the variable gives:
<META HTTP-EQUIV="refresh" content="1;URL=http://...=\"1406746\"">'
Should there be a " after the URL=?
That may be screwing it up.
You also probably want to call a function (don't of its name) to convert the
"s into the proper HTTP encoded format. (%22 ?)
On 3/29/07, Ravi Malghan <rmalghan@yahoo.com> wrote:
>
> Hi: I am having trouble passing double quotes when passing a url string.
> Everything after the double quotes does not go through. For example in the
> perl script below, the browser ends up going to
> http://appserver/arsys/forms/rearsp...er+View/?&qual='TRS%20Ticket%20Number'=
>
> --------SCRIPT----------
> $url = "
> http://appserver/arsys/forms/rearsp...er+View/?&qual='TRS%20Ticket%20Number'=\
> "1406746\"";
> <HTML>
> <HEAD>
> <TITLE>Redirect to my Trouble Ticket</TITLE>
> </HEAD>
> $url = "
> http://appserver/arsys/forms/rearsp...er+View/?&qual='TRS%20Ticket%20Number'=\
> "1406746\"";
> print '<META HTTP-EQUIV="refresh" content="1;URL=$url">';
> </HTML>
> -----------------------------------
>
> How do I pass double quotes so the browser goes to
> http://appserver/arsys/forms/rearsp...er+View/?&qual='TRS%20Ticket%20Number'="1406746"
> ?
>
> Thanks
> Ravi
>
>
>
>
> ________________________________________
________________________________________
____
> Now that's room service! Choose from over 150,000 hotels
> in 45,000 destinations on Yahoo! Travel to find your fit.
> http://farechase.yahoo.com/promo-generic-14795097
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/
>
>
>
--
- Yitzchok Good
| |
| Rob Dixon 2007-03-30, 6:58 pm |
| Ravi Malghan wrote:
>
> Hi: I am having trouble passing double quotes when passing a url string. Everything after the double quotes does not go through. For example in the perl script below, the browser ends up going to http://appserver/arsys/forms/rearsp...3AHelp+Desk/Def
ault+User+View/?& qual='TRS%20Ticket%20Number'=
>
> --------SCRIPT----------
> $url = "http://appserver/arsys/forms/rearsp01/HPD%3AHelp+Desk/Default+User+View/?&qual='TRS%20Ticket%20Number'=\"1406746\"";
> <HTML>
> <HEAD>
> <TITLE>Redirect to my Trouble Ticket</TITLE>
> </HEAD>
> $url = "http://appserver/arsys/forms/rearsp01/HPD%3AHelp+Desk/Default+User+View/?&qual='TRS%20Ticket%20Number'=\"1406746\"";
> print '<META HTTP-EQUIV="refresh" content="1;URL=$url">';
> </HTML>
> -----------------------------------
>
> How do I pass double quotes so the browser goes to http://appserver/arsys/forms/rearsp...er+View/?&qual='TRS%20Ticket%20Number'="1406746" ?
Hi Ravi
The double quote is an unsafe character and may not appear in URLs.
You can encode it as %22, but are you sure you need double quotes
here?
Rob
|
|
|
|
|