now, i want to use the variable stored in the string $gamename across another php script
the another script is basically called scoreboard.php and i need the variable in the $gamename so i can do a mysql lookup and show all the highscore for the game the user is currently playing, i.e. index.php?game=DTunnel
Originally posted by maddudemike yeah store sessions in your MYSQL database. Then when they goto or get sent to scoreboard.php check their ip match it to a session then check for the gamename in mysql associated with that session.
maddudemike, please, don't give bad advices if you are not familliar with the matter. What you're suggesting will work but is unnecessary overhead and will make the developer code more.
Sessions are stored in MySQL db in certain circumstances, for instance - when working with clustered servers.
Also, you can specify your own session_save_handler so you don't have to re-write the entire session logic.
Solution to this is just starting a session, setting a session variable and then reading it/comparing values.
Trivial problem with trivial solution. You just need session_start(); and $_SESSION['game'] = $game;