Send Data From PHP to C# or VB.NET - c#

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.

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)
PHP outputs XML when the client application requests the data
The client then parses the XML pulling the data from it and storing it as a native data structure

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.

Related

PHP communicate with program

I'm currently planning on a project I want to work on. These are the steps:
User visits the website and searches for a name
PHP sends a command to a C# or Java program
Program sends JSON data back to the website
PHP saves data to MySQL and shows data to user
I'm trying to research what I need to do to make this work. I just need advice on what to search for to learn. How do I make PHP and the program communicate? Should I look into servlet? Any advice on doing the steps more efficient like making the program query the database instead.
Personally, I'd prefer Web-Service for your situation. you can design a Web-Service method for C# or Java , these mechanism provides a platform for your PHP application ( or another applications ). the PHP application only call the Web-Service methods. WS method perform the search and return the result. then you can process the result and do whatever you want.
Do this by database. Make a java thread scheduler which seance a database table each time. Now whenever PHP receive a request then it will insert that request into database with a new flag, now Java thread which is sensing the database will pick the request from database and process that and after processing will put the response into database , now PHP can pick that response and send back to USER.
May be you can use shell_exec from PHP to communication with C# or Java
Please read PHP Manual for using shell_exec

c# client (windows) - server (linux debian) solution

I need help with small app I am working on.
Its small client collecting some data from user and I need to sent them to server and receive data from server... Last time I made it: client in c# was getting data from server through webserver PHP...(sending POST request via c# and parsing output page) It will be beter to have TCP/IP connection...
Whats the best and easy solution to do that? I have skills in php, c# (not c++)
Does MONO support all c# socked functions? Is it possible to run MONO on linux debian server without graphical interface.. (bash only)?
I need to: send/receive data and authenticate user...
thx for help

C# + PHP in the same application?

What im trying to do is a little different, im wondering, if its possible to create sorts of an interface, so that if a particular function is called in php (stand alone), than the arguments will be forwarded to a method in C#, and vice versa.
Depends of course on what kind of data you want to exchange, if the applications are on the same server or on two different ones etc.
I did briding between PHP and C# in some of my web based projects. What I did: create an ASP.NET MVC project which exposes a RESTful API. The methods exposed by this API are then called from PHP via HTTP (using CURL). I used JSON as a data exchange format to pass data from PHP to C# and back again. This worked good as the two applications were on different servers.
I could also imagine some kind of socket server. E. g. a background process written in C# is listening on some port, and then you connect to it via PHP´s socket functions. I did something like this to connect PHP and Java. The Java app ran as a demon process on port XXXX and was a wrapper around Apache FOP. I used PHPs socket functions to pass XML and XSLT to the Java demon which then used Apache FOP to transform the data into a pdf and returned that via the socket connection back to PHP which in turn sent the PDF file to the client requesting the page.
There are probably some other approaches, but these were my experiences so far in connecting two different technologies together.
EDIT: as an aside: PHP on a windows webserver using IIS was really not that nice to work with. Sometimes strange errors occured or certain permission related errors that were not easy to resolve. YMMV though.

How to send data from local PC to Google-app-engine application?

I have to write client program in C# that have to take some data from DB and sent it to my Google application(Java). How can I do that? What is the best way to do that?
It'll be great if there be some code example in answers.
You can put your data in JSON format and send it with server request, but I`m not sure does JAVA support working with JSON.
You need to create a web service in your app engine app that would take post data and consume it.
Preferably Use a web service framework otherwise you will have to do a lot of xml parsin yourself, which is baaed. mmmkay
Now I dont know if ur using py or java, but do look for a web service framework in ur language. mmkay

AMF through a BinarySocket written in .net

I have a windows service behaving as a Binary Socket sending data to flex applications.
Once I try to send strings or int's or any other native data-type, everything is working great.
I even succeeded in sending JSon from the server to the client parsing it on Flex.
I want to send AMF objects to the client.
Meaning, I have a class called User, I want to fill it with data and send it to the client, there I want it to be mapped to an object on the client.
How can I achieve this?
I'm not sure if any of these links is what you want:
http://www.adobe.com/devnet/flex/articles/class_mappings.html
http://www.adobe.com/livedocs/flex/2/langref/flash/net/package.html#registerClassAlias%28%29
http://livedocs.adobe.com/flex/3/langref/flash/utils/IExternalizable.html
but it should get you started, and google can take you from there. I remember there was this adobe page with a ton of examples of sending various data types to C#, but I can't seem to find it right now.

Categories