Share variables between different sessions on server?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Tchapman
Forum Newbie
Posts: 11
Joined: Wed Dec 01, 2010 3:38 am

Share variables between different sessions on server?

Post by Tchapman »

Is it possible to share variables between different users connected to a server? For example, if one client loads a php file and is able to send variables to the server, and the server can respond to that client, can another client at a different location load a php file on the same server and have the two clients have access to each others variables? I think it would be easy to have each client create a file on the server or FTP and the other client could read those files, but I am looking only for temporary real time solution, almost like a relay chat works.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Share variables between different sessions on server?

Post by requinix »

Use a database.
Tchapman
Forum Newbie
Posts: 11
Joined: Wed Dec 01, 2010 3:38 am

Re: Share variables between different sessions on server?

Post by Tchapman »

Great, thanks for that advice. I did figure out how to have the two devices reading and updating the database and it is pretty close to real time transfer, more than adequate for the application.
Post Reply