Solved

ampersand problem

Posted on 2011-09-18
2
563 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
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 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