I need to "pack" a URL into a URL as one of the parameters to a script. For example:
http://cgi3.ebay.com/aw-cgi/eBayISAPI.dll?MfcISAPICommand=SignInWelcom
+e&userid=userid&pass=pass&keepMeSignInOption=1&ru=http%3A%2F%2Fcontac
+t.ebay.com%2Faw-cgi%2FeBayISAPI.dll%3FReturnUserEmail%26requested%3Du
+ser%26de%3Doff%26iid%3D1733367971%26frm%3D284%26acceptcookie%3D1%26lo
+ginconfirmed%3D1%26pass%3D%7B_pass_%7D%26userid%3D
If you look deep into the URL, you see the parameter "ru". That parameter has to be an encoded url.
I know that string as a literal would work fine.
So what's my problem?
I want the "ru" parameter as a separate, readable string in perl, so developers don't kick themselves when they look at my uncommented.
Code:
$main_request = "http://cgi3.ebay.com/aw-cgi/eBayISAPI.dll?MfcISAPICom
+mand=SignInWelcome&userid=userid&pass=pass&keepMeSignInOption=1&ru=";
$ru = "http://encode_this/";
# Encode $ru ?????
$main_request += $ru;
# Send $main_request
Thanks for the help.
-Keith
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.