How to access PHP pages?

Posted on 2006-05-25
Medium Priority
Last Modified: 2012-05-05

I'm trying to create win32 application that access php pages by using delphi.
(I need to be able to use POST and GET method)
The problem is, I don't know which component/ object I should use
(and also how to use it).
Please someone help me.
Question by:Winart
  • 2
LVL 10

Expert Comment

ID: 16761605
LVL 17

Expert Comment

ID: 16765412
If you mean you just want to talk to a .php page on another server, then any HTTP component will do,
e.g. with Indy (TIdHTTP) it would be
IdHTTP1.Put or IdHTTP1.Get

If you wish to act as a php page yourself, then php4delphi (as mentioned above) is great
I had a little noobish trouble getting it set up right, but got there in the end

Author Comment

ID: 16768470
Hi Loki,

I prefer your approach,
do you know where I can find the complete documentations and samples?
LVL 17

Accepted Solution

TheRealLoki earned 1600 total points
ID: 16772474
Indy will download the webpage, be it html or php, with POST or PUT or GET but it does _not_ display it.

Indy 9 ships with Delphi 6+ I think
you can also download it from http://www.indyproject.org/Sockets/index.en.aspx

put a TidHTTP (from the Indy Client tab) on the form and set its'
HandleRedirects property to True

procedure TForm1.Button1Click(Sender: TObject);
        s: string;
        S := IdHTTP1.Get('http://www.google.com');
// or S := IdHTTP1.Get('http://www.somesite/somepage.php?userid=5&somethingelse=2');
        memo1.lines.text := s; // display it in a memo

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

839 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