How to access PHP pages?

Posted on 2006-05-25
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
    LVL 10

    Expert Comment

    LVL 17

    Expert Comment

    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

    Hi Loki,

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

    Accepted Solution

    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

    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('');
    // or S := IdHTTP1.Get('http://www.somesite/somepage.php?userid=5&somethingelse=2');
            memo1.lines.text := s; // display it in a memo

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    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…
    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…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now