You can use something like sessions, cookies or GET / POST variables. Sessions and cookies are quite easy to use, with session being by far more secure than cookies. More secure, but not completely secure.
Remember to run the session_start() statement on both these pages before you try to access the $_SESSION array, and also before any output is sent to the browser.
The big difference between sessions and cookies are that the value of the variable will be stored on the server if you're using sessions, and on the client if you're using cookies. I can't think of any good reason to use cookies instead of sessions, except if you want data to persist between sessions, but even then it's perhaps better to store it in a DB, and retrieve it based on a username or id.
GET and POST
You can either add the variable in the link to the next page:
//Using GET
$var_value = $_GET['varname'];
//Using POST
$var_value = $_POST['varname'];
//Using GET, POST or COOKIE.
$var_value = $_REQUEST['varname'];
Just change the method for the form to post if you want to do it via post. Both are equally insecure, although GET is easier to hack.
The fact that each new request is, except for session data, a totally new instance of the script caught me when I first started coding in PHP. Once you get used to it, it's quite simple though.
also remember your player base. If you plan on having thousands of players you will be created hundreds even thousands of concurrent sessions. That can become a memory issue depending on your server.
well im keepin sesions down to a minimum. and using cookies for stuff like battles to stop people escaping (i.e closing down the browser) from battles without taking concequences.
i did consider POST and GET variables... but its not just like a 1 word variable. its entire sentances lol.
creature has caused X damage to you
you have caused X damage to creature.
so instead of going down the route halls did. and clicking attack then clicking go back to fight or what ever it was. you click attack and it goes to another page does the turns then returns you to the fight page without you seeing nothing else.
a easy fix to people leaving the browser in the middle of a fight is have the battle page minus 100exp per level or whatever when it loads. Then place text saying "If you leave the battle improperly you will suffer an exp loss." Then when either, the player kills the creature, dies, or runs, it adds the exp back.
no im making it so there is no escape other than dyin winning or running.and if you close the browser and come back to the site. you are back in battle. also you cant change page untill the battle is over (do something else. go to shops. veiw profile pages etc)
thats another flaw i see in halls way of doing it (no offence :p) one person goes up against a creature starts fighting it... then someone gets the same creature and it starts off with like half hp. then everything gets messy because 2+ people are trynig to fight the same thing with constatly changing variables.
so i just store the stats inside cookies and use them to do do all the stuff it needs to then delete them at the end of the battle. means i dont have to keep updating the creature list and putting in about 1000 of each creature to try stop people getting the same one.
i didnt know you were using the tuts as an example. In my example I use it Planetary wars, where everything is instanced. So it doesn't really matter. You could just set a variable at the same time that makes a creature not fightable if it is set to true. Then make your creature query select * where that does not equal that variable. Then set a cron to delete half dead creatures everyday.
Eh so many ways to do it. I like your way it works.