in reply to ampersand in

Here's how to find out where the caption gets truncated. Insert:

print "<p>$form_data{'caption'}</p>$/"; # DEBUG
after each block of code. Then you will know which use needs a different form of quoting or escape. If you're parsing cgi on your own, it's likely that & is taken as an URL delimiter and you never see the rest of the caption.

Ovid hints at this, I'll spell it out:

use CGI; # or die

If this tactic doesn't show you what's wrong, please post the code here.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: ampersand in
by ginocapelli (Acolyte) on Sep 08, 2001 at 03:11 UTC
    Here is the code (the script is www.e-classifieds.net Standard Edition):
    if (($fields[$index_of_pmail] eq "No" || $fields[$index_of_pmail] eq " +") && ($form_data{'show_temp_ads'} eq "")) { print qq~ <a href="$script_url?session_key=$session_key&display_reply_form_butto +n=on&results_format=off&db_id=$fields[$index_of_db_id]&exact_match=on +&query=retrieval">Reply to Ad</a>~; } else { print qq~ <a href="mailto:$fields[$index_of_email]?subject=Reply To Ad #$fields[ +$index_of_id] at $sitename">$fields[$index_of_email]</a>~; }
    Even if I try to display a link like this: <a href="mailto:rob@ebrae.com?subject=Bob & Tom">rob@ebrae.com</a> The subject line still reads: Subect: "Bob " Do you think there is even a way around this, regardless if the output is cgi generated?
      Try replacing your spaces with the '+' sign...
      <a href="mailto:rob@ebrae.com?subject=Bob+&+Tom">rob@ebrae.com</a>
      More generally you should look at the uri_escape function in the URI::Escape module.

      -Blake