monkeymax Posted March 11, 2006 Share Posted March 11, 2006 I've been unsucessfully trying to get this to work for the last hour so I thought I would turn to the experts!The situation is that I have a page of matches that I would like the user to select from. Say the page is called "matches.php". The table would look like:Match 1 Dog vs CatMatch 2 Praying Mantis vs Butterfly....The match players are links, and the match number and player id are passed back to the page, so Dog would be linked as:<a href="matches.php?match=1&player="Dog">Dog</a>Now my problem is when the page is reloaded, I want these details to be stored in an array. I thought it would be as simple as:if(!isset($_GET['match'])){ $match_array=array();}else{ $match_array[$_GET['match']] = $GET['player'];}Which would be working perfectly [b]except[/b] for the fact that the array gets reloaded everytime I load the page, so it only ever has one entry. I would like it to store all previous match data. I don't have much experience with static and global variables and was hoping someone would be able to suggeset a solution for this,Thanks! Link to comment https://forums.phpfreaks.com/topic/4664-populating-array-on-page-reload/ Share on other sites More sharing options...
k.soule Posted March 11, 2006 Share Posted March 11, 2006 Pass the array with sessions, simplest solution I can think of. Link to comment https://forums.phpfreaks.com/topic/4664-populating-array-on-page-reload/#findComment-16342 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.