Jump to content


Photo

Reference Number [RESOLVED]


  • Please log in to reply
4 replies to this topic

#1 syrkel

syrkel
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationCanada

Posted 20 August 2006 - 11:00 PM

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:
for (var d = 0; d<_root.whosonlinearray.length; d++) {
	_root.multiplayer_send_lv["loginID"+d] = _root.whosonlinearray[d];
}
And now in PHP I want it to read $loginID1, $loginID2, and so on. But I have tried such things as:
$t = 0;
$loginID = eval("\$loginID$t");
$t++;
$t = 0;
$loginID = $("loginID" . $t);
$t++;
$t = 0;
$loginID =& "\$loginID$t";
$t++;
$t = 0;
$loginID = "\$loginID$t";
$loginID =& eval($loginID);
$t++;
But my command that it's referencing still won't work:
if ($row['loginID'] == $loginID) {
or
if ($row['loginID'] == eval("\$loginID$t")) {

Or anything of such...

Can anyone help with this?

#2 syrkel

syrkel
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationCanada

Posted 23 August 2006 - 11:36 PM

*Waits in suspense for a response*

#3 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 23 August 2006 - 11:39 PM

Depending on the method of sending the data, GET or POST, you can use:

$loginID = $_GET['loginID' . $n];
or
$lognID = $_POST['loginID' . $n];

Where $n is an int.

#4 syrkel

syrkel
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationCanada

Posted 24 August 2006 - 12:45 AM

Thanks very much ^_^

#5 syrkel

syrkel
  • New Members
  • Pip
  • Newbie
  • 4 posts
  • LocationCanada

Posted 23 September 2006 - 08:50 PM

I can also use $$variable.

More here:
http://ca.php.net/ma...es.variable.php




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users