Solved

ampersand problem

Posted on 2011-09-18
2
570 Views
Last Modified: 2012-05-12
Hi all. I have noticed a strange behavior of a my application. I use TIdHTTP in Delphi 7 to contact a php page on my server. Since parameters to send are in a StringList and I use Get method, I build url this way

url := 'http://mysite.com/mypage.php?' + '&0=' + TIdURI.ParamsEncode(sl[0]) + + '&0=' + TIdURI.ParamsEncode(sl[1]); and so on...

The problem is that ampersand disappears and if I do a Showmessage to see the builded url I have something like:

'http://mysite.com/mypage.php?param1=abcparam2=def

and obviiously get call fails.

Any idea?
0
Comment
Question by:Marco Gasi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
acbxyz earned 500 total points
ID: 36555964
If the first letter after your wanting ampersand gets underlined, this issue is from showmessage(). An apersand is often used to declare the coming letter as shortcut. If you want to debug your url with showmessage() you should use
ShowMessage(StringReplace(url, '&', '&&', [rfReplaceAll]));

Open in new window


However this should not affect your http engine.
0
 
LVL 31

Author Comment

by:Marco Gasi
ID: 36556103
Thanks, acbxyz. You're right: doubling ampersands makes them to appear ion the ShowMessage but this doesn't affect the http engine. Now I'll have to understand why something worked fine since some week ago now it fails :-(
I'm going to give you points since you have solved the ampersand problem.

Thanks.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi: ForceDirectory plain function 7 85
Delphi Seattle StructureView color 1 34
delphi popmenu non latine charcters 3 48
Firemonkey Tcameracomponent resultion 1 46
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question