Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / March 2007



Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scooby Doobie Doo - 30 Mar 2007 20:56 GMT
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?
Sojovi - 30 Mar 2007 21:13 GMT
UrlEncode the string you want to pass. & is a separator for URL addresses.
SafariTECH - 30 Mar 2007 21:15 GMT
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 is 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.