Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change report from send email to post to a php handler, need advice...
#2
Simply use TIdHTTP.Post() with a TStringList as input containing name=value pairs.  That will send an HTTP request in the standard application/x-www-form-urlencoded format, just like a web browser would send for a basic HTML <form> element.

For example:

Code:
var
  PostData: TStringList;
begin
  PostData := TStringList.Create;
  try
    PostData.Add('From=' + ...);
    PostData.Add('To=' + ...);
    PostData.Add('Message=' + ...);
    IdHTTP1.Post(url, PostData);
  finally
    PostData.Free;
  end;
end;

And then on the PHP side, you can use $_POST to read in the values, eg $_POST['From'], etc.

Reply


Messages In This Thread
RE: Change report from send email to post to a php handler, need advice... - by rlebeau - 12-21-2023, 04:58 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)