syrkel Posted August 20, 2006 Share Posted August 20, 2006 I am trying to have a Multiplayer Engine through PHP but I need it to read and store multiple variables... So what I am doing is I am sending variables from Flash like so:[code]for (var d = 0; d<_root.whosonlinearray.length; d++) { _root.multiplayer_send_lv["loginID"+d] = _root.whosonlinearray[d];}[/code]And now in PHP I want it to read $loginID1, $loginID2, and so on. But I have tried such things as:[code]$t = 0;$loginID = eval("\$loginID$t");$t++;[/code][code]$t = 0;$loginID = $("loginID" . $t);$t++;[/code][code]$t = 0;$loginID =& "\$loginID$t";$t++;[/code][code]$t = 0;$loginID = "\$loginID$t";$loginID =& eval($loginID);$t++;[/code]But my command that it's referencing still won't work:[code]if ($row['loginID'] == $loginID) {[/code]or[code]if ($row['loginID'] == eval("\$loginID$t")) {[/code]Or anything of such...Can anyone help with this? Link to comment https://forums.phpfreaks.com/topic/18142-reference-number-resolved/ Share on other sites More sharing options...
syrkel Posted August 23, 2006 Author Share Posted August 23, 2006 *Waits in suspense for a response* Link to comment https://forums.phpfreaks.com/topic/18142-reference-number-resolved/#findComment-79621 Share on other sites More sharing options...
hitman6003 Posted August 23, 2006 Share Posted August 23, 2006 Depending on the method of sending the data, GET or POST, you can use:[code]$loginID = $_GET['loginID' . $n];or$lognID = $_POST['loginID' . $n];[/code]Where $n is an int. Link to comment https://forums.phpfreaks.com/topic/18142-reference-number-resolved/#findComment-79623 Share on other sites More sharing options...
syrkel Posted August 24, 2006 Author Share Posted August 24, 2006 Thanks very much ^_^ Link to comment https://forums.phpfreaks.com/topic/18142-reference-number-resolved/#findComment-79640 Share on other sites More sharing options...
syrkel Posted September 23, 2006 Author Share Posted September 23, 2006 I can also use $$variable.More here:http://ca.php.net/manual/en/language.variables.variable.php Link to comment https://forums.phpfreaks.com/topic/18142-reference-number-resolved/#findComment-97377 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.