-1

Please I need to know how to send parameters from Delphi application to php page then php will make some calculations on these parameters and return result again to Delphi?

Arioch 'The
  • 15,799
  • 35
  • 62
ayman
  • 13
  • 1
  • 8
  • use HTTP GET or HHTP POST to send parameters, then use PHP script to work it, jenerate JSON file/webpage with results and parse those results in Delphi program – Arioch 'The Oct 29 '13 at 10:30
  • So what is the API between server and client ? do you have a fixed Server APi so that you need to make Delphi client compatible ? or do you have a fixed Delphi client APi, so you need to develop a PHP server compatible ? – Arioch 'The Oct 29 '13 at 10:32
  • Thank you Mr Arioch for your reply, Sorry I am beginner in Delphi and also PHP so apologize me, I send data from delphi to php(2 digits) and multiplyed them inside php, i need now to return the result(result of multiplication) again to delphi program and print it there, how can I do this? – ayman Oct 29 '13 at 10:51
  • you have 3 questions rather than one: 1) which protocol specification you would design for server-client interactions, regarding the requirements to the task, 2) how to implement that protocol in PHP server (or non-PHP server), 3) How to implement that protocol in Delphi Client. And there are uncountable number of variants to answer all those questions. This site seldom work in "write the program for me" manner. So you better answer those questions separately. http://en.wikipedia.org/wiki/Divide_and_conquer http://stackoverflow.com/help/on-topic – Arioch 'The Oct 29 '13 at 11:01

1 Answers1

1

One of straight-forward ways in REST pattern (http://en.wikipedia.org/wiki/REST) would be:

1) Your Delphi client gets the page, passing all the parameters as HTTP GET or HTTP POST.

using any library you wish. Some choices (not complete list) include:

et cetera

2) your PHP server gets those parameters and generates JSON page with the results

3) your Delphi client getting the page via HTTP, then parses JSON and works with the resulting variables

Some libraries to parse JSON are

4) do with the received data what you want to do

Community
  • 1
  • 1
Arioch 'The
  • 15,799
  • 35
  • 62