0

Today'm trying to pass a variable and an array of PHP to a desktop application, but I have no clue how to do it.

To be more precise in my question I need PHP run the Desktop Application Developed in C # or VB.NET and send a variable.

If anyone can help me with some solution,suggestion or method is welcome Thank You.

4
  • when you say desktop what OS are you using, Windows? Are you looking for the PHP to run on the desktop or on a separate server? Commented Sep 18, 2011 at 18:06
  • The web server is Linux (Centos 5.6), I need PHP RUN the Desktop App in the Client (Microsoft XP) Commented Sep 18, 2011 at 18:09
  • The Developed APP is hosted in the Same Client PC. For Example: <?php run('C:/app.exe?var=this_is_an_example'); ?> Commented Sep 18, 2011 at 18:11
  • Here how to execute program php.net/manual/en/book.exec.php, add to execution path some parameters and handle this parameters in C# Commented Sep 18, 2011 at 19:05

2 Answers 2

1

You should send the information to the client in a format you can parse client side. XML would be one example.

So if you go the XML route (I'd look for a better transport data structure)

  1. PHP outputs XML when the client application requests the data
  2. The client then parses the XML pulling the data from it and storing it as a native data structure
Sign up to request clarification or add additional context in comments.

Comments

1

Given your clarification in your comment (that you want to do this on the client machine), the answer is you can't. PHP doesn't run on the clients machine, it runs on your server and outputs to the clients browser, the browser then interprets that and displays the results, the browser doesn't run other applications as that is asecurity breach...except when downloading certain mime-types. If you are doing this with the users knowing cooperation, that might be a solution. If you control both code bases (the PHP and C#), then it's more likely, it would make more sense for the user to run the desktop app and for it to communicate with the PHP page to get the info it has.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.