Recent

Author Topic: PHP  (Read 2892 times)

skaner1900

  • Jr. Member
  • **
  • Posts: 59
PHP
« on: January 07, 2012, 07:21:17 pm »
I've got a PHP form and I want to send data to application (by POST method)
How to receive values from the form?
And how to send an answer to PHP?

procedure TForm1.LHTTPReceive(aSocket: TLSocket);
var
  r,s:string;
begin
  if aSocket.GetMessage(r) > 0 then
    begin
    Memo1.Lines.Add(r);
    end;
  s:='HTTP/1.1 302 Moved Temporarily'+'Location: http://google.com'+'Connection: close';
  LHTTP.SendMessage(s,aSocket);
end;

procedure TForm1.ButtonConnectClick(Sender: TObject);
begin
  LHTTP.Listen(StrToInt(EditPort.Text));
  if LHTTP.Listen=true then Memo1.Lines.Add('receiveing on port: ' + EditPort.Text);
end;

 but, PHP can't find the page :/ (it works when i try do it via lnet and TCP ... but very slow... and i receive too much data from PHP)
« Last Edit: January 07, 2012, 08:00:47 pm by skaner1900 »

goodname

  • Sr. Member
  • ****
  • Posts: 297
Re: PHP
« Reply #1 on: January 07, 2012, 11:37:00 pm »
So guessing that you generate a html form using php. The browser then sends a POST request to a fpc program. The fpc program responds to the browser request. If this is the case then your looking for http://wiki.lazarus.freepascal.org/fcl-web. If not then more information is required.
« Last Edit: January 07, 2012, 11:40:21 pm by goodname »

 

TinyPortal © 2005-2018