hello Lapo,
I used a simple php script to connect to the sfs. I create the socket, then connect to the server, then I send some data.. but I don't get the response
here is the small script.. I used bold on the areas that might present a problem.
<?
$ip = '216.xxx.xxx.xx';
$port = 'xxxx';
/* Create a TCP/IP socket. */
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if ($socket < 0) echo "socket_create() failed: reason: " , socket_strerror($socket) , "\n";
else echo "OK.\n";
$result = socket_connect($socket, $ip, $port);
if ($result < 0) echo "socket_connect() failed.\nReason: ($result) " . socket_strerror($result) . "\n";
else echo "OK.\n";
$in = "<msg t='sys'><body action='verChk' r='0'><ver v='102' /></body></msg>";
$out = '';
socket_write($socket, $in, strlen($in));
while ($out = socket_read($socket, 2048)) {
echo $out;
}
socket_close($socket);
?>
getting some zone info using php
getting some zone info using php
Last edited by dream on 08 Nov 2006, 10:47, edited 2 times in total.
nature has a funny way of breaking what does not bend
i can't seem to get it to work.. I tried both the "\0" char and "\x00" in php..
do you have an article on general php clients trying to emulate the flash xml send function? I have searched but did not find anything valuable...
I connected also via telnet just for fun but was not able to send a message because I don;t know how to send the 0x00 character in the end
do you have an article on general php clients trying to emulate the flash xml send function? I have searched but did not find anything valuable...
I connected also via telnet just for fun but was not able to send a message because I don;t know how to send the 0x00 character in the end
nature has a funny way of breaking what does not bend
do you have an article on general php clients trying to emulate the flash xml send function?
No, we don't have articles about PHP connectin' to SFS.
However PHP has a rich set of functions, I'd recommend to check the online documentation (www.php.net) or download the manual and look for examples under the "Socket" section or the "String" section.
You probably need a String function that adds a 0x00 byte to the end of your string or to the socket byte stream.
No, we don't have articles about PHP connectin' to SFS.
However PHP has a rich set of functions, I'd recommend to check the online documentation (www.php.net) or download the manual and look for examples under the "Socket" section or the "String" section.
You probably need a String function that adds a 0x00 byte to the end of your string or to the socket byte stream.