Results 1 to 3 of 3
Thread: PHP Send data to another Server
Sep 27, 2011, 02:18 #1
PHP Send data to another Server
I have a php script which gets data from the server A using shell_exec() and then save its results to a variable (I have three variables i.e. $Username, $Status, $IP). Then i display them as needed.
Now i want to send these data to Server B and there i want to display the results of these variables.
I have found some curl script http://www.codingforums.com/archive/.../t-160319.html
But i am confused because I am not sure how to do it in a real server , i.e. how to connect to the Server A. In the above line there is nothing mentioned about the connection to ServerB
Also , Will it work on a shared server (which normally uses cPanel).
Sep 27, 2011, 04:14 #2
In the above line there is nothing mentioned about the connection to ServerB
- Join Date
- May 2006
- Central Florida
- 169 Post(s)
- 4 Thread(s)
This need not (necessarily) be a domain name, it could be the IP address of the other server.
One server is 'feeding' the values in a PHP script and the other 'reads' the output of that page.
If you simply need to pass data (information) between servers, you should investigate SCP.
Sep 27, 2011, 04:53 #3
- Join Date
- Jan 2008
- Knoxville TN
- 51 Post(s)
- 0 Thread(s)
cURL is for situations where your server must act as a client - most frequently with payment gateways. The SSH2 functions (of which scp is a part) come up more rarely. I'm working on a script right now that does this using this library http://phpseclib.sourceforge.net
I don't know if there's anything more recent out there - the version of that library the code I inherited is using was written for PHP 4. It seems to work well enough though.