Jump to content

Archived

This topic is now archived and is closed to further replies.

syrkel

Reference Number [RESOLVED]

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
I can also use $$variable.

More here:
http://ca.php.net/manual/en/language.variables.variable.php

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.