File and socket handles
| From: | Robin Gilks | Date: | Sat, 02 Dec 2000 18:41:31 +0000 |
| Subject: | File and socket handles | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-28377@lists.php.net to get a copy of this message | ||
Greetings all
I've scanned the list archives but not found anything that relates to my
problem with socket handles.
I want to open a socket connection from one frame (script) and transmit data
to the user from that socket - no problem there, all working fine using
either fsockopen or pfsockopen.
I also want to use the same connection for data from the user to the socket
from another frame and I can't find a way of passing the socket handle to the
script that handles that part of the transaction.
I've tried hidden fields and passing it via a database but each time I get
"Warning: Supplied argument is not a valid File-Handle resource in
/blah.php on line xxx"
Looking at the variable I pass about I have the value "Resource id #1"
which I understand means the variable is entirely internal to php and can't
be represented outside of the interpreter and hence convey its value.
All I wanna do it
$handle = fsockopen(host,port);
in one script and use
fputs($handle,$data)
in another one with some means of passing "$handle"
So how the heck do I pass it around - there must be a way!!
--
Robin
Internet: g8ecj@abmdata.demon.co.uk http://www.gb7ipd.freeserve.co.uk/
Anorak mode = Shack: (+44) 1628 533311 Fax: (+44) 1628 850165
Club pages (g4xyw modem etc) at http://www.tvipug.org