Sending data from web server to a specific computer
Hi all,I am making an application in which I need to send some data from my database in the webserver to a specific computer.
I mean to say that when a certain event will done,then some data with specific id in the database in webserver,will be sent to a computer where a c# application resides and that application will parse that data.How can I do this?
I have web skills(html,php/mysql etc) but I am not aware that how to do this.Plz help me
Thanks
Since you have a listening application on the remote machine, look at using the fsock* family in PHP to create sockets (check this link: http://php.ca/manual/en/ref.network.php). It really depends a lot on what the C# application is doing itself, its possible that alternate protocols can be used like FTP, SSH and so forth too.
This assumes you have an underlying understanding of this C# application. If not, consult the documentation for the application to see what its listening for, and on what port.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Thanks,now I tell you what I am doing
A c# server,a c# Client,a website.It is a surveillance system.
Many cameras are attached to the server,a software is on the site(client software).User will signup on the site and download the client application.
Now the client puts user name etc in the client application and and clicks sign in button and then the data(username,password,ip,id) goes to website's database to check if this exists in database,if it exists then that data will be sent to the server,server will open the cam for that user and user will watch video.You got whole the thing?
Plz now tell me what to do.
I don't know why you'd use PHP at all. Sounds to me like you have an appropriate client / server application up and running where the client can communicate with the server and presumably authenticate with it as well. I wouldn't add the PHP middle man if you don't need it. The server software should be capable of communicating directly with the database to check the authentication required.
Have you checked the links for the fsockopen in the networking features? That will allow you to create a socket to a remote machine; it doesn't matter if the machine is a server or a client as long as its listening. Once connected, you formulate the appropriate data to send across to the remote machine, which will be fairly custom since it needs to match what the remote machine is capable of understanding.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php