Page 1 of 1

i need a brief code guide on sockets

Posted: Sat Apr 15, 2006 11:40 am
by The-Master
hi, i have read some php sockets tutorials and i still need some help,
i made this code:

Code: Select all

<?php
$fp = fsockopen( "www.mysite.com", 80, $errno,
$errdesc);
// some code needed here <<<
fclose($fp);
?>
and i want to make that when a client connects to the server and another one does too they share the same vars.
in simple words if two users are connected, the value of the var "$nice_var" is the same for both users...

Posted: Sat Apr 15, 2006 11:58 am
by feyd
If you don't have shared memory, there's no simple way to do it. You'll need an intermediary such as a file or database to hold the data. If you make any modifications of those variables you'll need synchronising code as well. Generally, I wouldn't recommend it.