I am using the GET command to retrieve customer info. When the customer name includes the ampersand, example Joe & Jane, the printout returned is only "Joe". Here is the GET call being used:

www.mysite.com/cgi-bin/customer_info_get.pl?f5=CID&f6=Joe & Jane

The cgi definitions are: $EID="$FORM{'f6'}"; and $customer ="$FORM{'f5'}"; The print command is: print "<font size=\"3\"><b>Customer Info For -- <font><font size=\"5\"><u>$EID</u></b></font>";

This print command does not return Joe & Jane, only Joe. However, if I change the code to print CINFO "<font size=\"3\"><b>Customer Info For -- <font><font size=\"5\"><u>Joe & Jane</u></b></font>" then Joe & Jane are printed out. It seems the command is correct. The question is why is the ampersand not being interpreted as part of the variable $EID.

<Any and all assistance will be appeciated.

Thanks for all the suggestions. The problem has been solved. Rather than asking the cgi program to "escape" the ampersand, it was removed from the GET query by changing f6=Joe & Jane to f6=Joe %26 Jane. That change results in Joe & Jane being printed.><Thanks again!>


In reply to Value not being interpreted by Milti

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.