# Flash MX 2004 to PHP getting variables

**URL:** <https://forum.kirupa.com/t/flash-mx-2004-to-php-getting-variables/63988>\
**Category:** programming\
**Created:** [September 12, 2004, 5:56am UTC](https://forum.kirupa.com/t/flash-mx-2004-to-php-getting-variables/63988 "2004-09-12T05:56:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![3rdeye](https://avatars.discourse-cdn.com/v4/letter/3/58f4c7/32.png) [@3rdeye](https://forum.kirupa.com/u/3rdeye)\
**Post date:** [September 12, 2004, 5:56am UTC](https://forum.kirupa.com/t/flash-mx-2004-to-php-getting-variables/63988/1 "2004-09-12T05:56:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 12, 2004, 6:54am UTC](https://forum.kirupa.com/t/flash-mx-2004-to-php-getting-variables/63988/2 "2004-09-12T06:54:41Z")

</div>

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](http://www.php.net/eval)

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 12, 2004, 7:14am UTC](https://forum.kirupa.com/t/flash-mx-2004-to-php-getting-variables/63988/3 "2004-09-12T07:14:19Z")

</div>

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

[http://php.he.net/manual/en/language.variables.variable.php](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++;  
};
