Flash MX 2004 to PHP getting variables

I’m sending a series of integers from Flash using sendAndLoad, simmilar to:

infoSend.imageTotal = 3
infoSend.imageNum1 = 435
infoSend.imageNum2 = 45
infoSend.imageNum3 = 9

infoSend.sendAndLoad(“http…”, infoLoad, “POST”);

my question is, how do I parse the data on the PHP side?

right now I have a while loop

while( $i <= $imageTotal){
[color=Red] $tempID = $imageNum[$i];[/color]
$result = mysql_query(‘SELECT * FROM tbl_mov WHERE movID=’.$tempID.’’,$dbcnx);
$data = mysql_fetch_array($result);
$str = $data[‘img_thumb’];
echo ‘&imgID=’.$i;
echo ‘&imgLoc=’.$str;
$i++;
};

the line in red is the only one I know isn’t working… anyone know how to structure it?

I suggest using $_POST[’’]; on all the variables that were sent from flash
e.g. $_POST[‘imageTotal’];

and for the tempID part. I can only say that u need eval(); Right now you’re tryng to get the $i-th member of the “imageNum” array but you have variables.

http://www.php.net/eval

I haven’t used eval much so I can’t give u the right code :to:

I found the answer, basically called variable variables, link here:

http://php.he.net/manual/en/language.variables.variable.php

what I did was:

while( $i <= $imageTotal){
[color=Red] $tempStr = ‘$imageNum’.$i;
$tempID = ${$tempStr};[/color]
$result = mysql_query(‘SELECT * FROM tbl_mov WHERE movID=’.$tempID.’’,$dbcnx);
$data = mysql_fetch_array($result);
$str = $data[‘img_thumb’];
echo ‘&imgID=’.$i;
echo ‘&imgLoc=’.$str;
$i++;
};