supanoob Posted September 6, 2007 Share Posted September 6, 2007 ok so i am working on a new battle script for my website and i am looking for a way to carry over the battle ID without using a form or the URL. Basically i want it carried over in such a way it cannot be tampered with. Can this be done or would i need to use: battle.php?battleid=$ID Link to comment https://forums.phpfreaks.com/topic/68204-solved-carrying-variables/ Share on other sites More sharing options...
micah1701 Posted September 6, 2007 Share Posted September 6, 2007 use sessions. <?php session_start(); //at the top of each page ... $_SESSION['battleid'] = "whatevertheIDis"; ... ?> then on the next page: <?php session_start(); ... echo $_SESSION['battleid']; ... ?> Link to comment https://forums.phpfreaks.com/topic/68204-solved-carrying-variables/#findComment-342906 Share on other sites More sharing options...
supanoob Posted September 6, 2007 Author Share Posted September 6, 2007 and how would i go about ending this session? and would this work for mulitple battles happenin at once? Link to comment https://forums.phpfreaks.com/topic/68204-solved-carrying-variables/#findComment-342928 Share on other sites More sharing options...
xyn Posted September 6, 2007 Share Posted September 6, 2007 session_destroy(); # destroys all unset($_SESSION); # destroys all (never used this) unset($_SESSION['name']); # Distroys single, or separate multiple with ',' Link to comment https://forums.phpfreaks.com/topic/68204-solved-carrying-variables/#findComment-342932 Share on other sites More sharing options...
supanoob Posted September 6, 2007 Author Share Posted September 6, 2007 session_destroy(); # destroys all unset($_SESSION); # destroys all (never used this) unset($_SESSION['name']); # Distroys single, or separate multiple with ',' would this session thing work with multiple battles going on at once? Link to comment https://forums.phpfreaks.com/topic/68204-solved-carrying-variables/#findComment-342933 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.