I've been mucking around with JS/Node/Socket.IO and made a little multiplayer game where you are all dots and can move around. I now want to take it a level further and add a simple login system so that I can display information from the user's login above their head to help identify different players.
Now I know that PHP is a server-side language and JavaScript is mainly client-side but I need to come up with a way to do this. What I'm really asking is, does anybody know how to get information straight from PHP into JavaScript?
Later on I might want to add levelling and store player's levels in a database and retrieve them when they connect (as opposed to using Local Storage).
Thanks very much!
Joel
json_encode()in PHP are your friends. Beyond that, you will have to be more specific as to what you are trying to do.