• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Var with & Losing half of text ??? why / prevention?

Explorer ,
Mar 30, 2007 Mar 30, 2007

Copy link to clipboard

Copied

I have a string I pass in a URL variable like this

Group=SE Sons & Company

Problem is, on the receiving page, it loses everything after the &

How can I prevent that from happening?
TOPICS
Advanced techniques

Views

260

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 30, 2007 Mar 30, 2007

Copy link to clipboard

Copied

UrlEncode the string you want to pass. & is a separator for URL addresses.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 30, 2007 Mar 30, 2007

Copy link to clipboard

Copied

LATEST
Try using URLencodedFormat to change the URL string before sending it along.

Placing them in quotes may help as well.

The other alternative is to use POST instead of GET if this is from processing a form.

The problem is that the ampersand (&) is a variable joiner in a URL, so when you pass it as you have shown above, the action page and browser see only the variable definition before the ampersand as one variable, and the data following that ampersand as a different variable which happens to be empty.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation