# Passing php variables to flash

**URL:** <https://forum.kirupa.com/t/passing-php-variables-to-flash/180054>\
**Category:** flash\
**Created:** [February 25, 2006, 1:55am UTC](https://forum.kirupa.com/t/passing-php-variables-to-flash/180054 "2006-02-25T01:55:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![red1000](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@red1000](https://forum.kirupa.com/u/red1000)\
**Post date:** [February 25, 2006, 1:55am UTC](https://forum.kirupa.com/t/passing-php-variables-to-flash/180054/1 "2006-02-25T01:55:53Z")

</div>

Hello!

I have been working on this issue awhile and am stumped… I have tried several forums and haven’t gotten a response…

I need to pass the following php information into flash…

> \<?php  
> defined( ‘\_VALID\_MOS’ ) or die( ‘Direct Access to this location is not allowed.’ );  
> $link = “\<img src ="$mosConfig\_live\_site/images/comprofiler/tn”;  
> $link\_gallery = “\<img src ="$mosConfig\_live\_site/images/comprofiler/”;  
> $imagewidth = 76;  
> $imageheight = 76;  
> $setwidth = “width="$imagewidth"”;  
> $setheight = “height="$imageheight"”;  
> $limit == “20”;  
> $number = " 20";

echo "\<center\>\<table\>\<tr\>  
";  
$query = “SELECT user\_id,avatar,hits FROM #\_\_comprofiler WHERE avatarapproved=1 AND avatar IS NOT NULL ORDER BY hits DESC LIMIT $number”;  
$database -\>setQuery ($query);  
$results = $database-\>loadObjectList();

foreach($results as $result){

if(preg\_match(‘/(jpg)/’,$result-\>avatar)){  
$query\_name = "SELECT id,username FROM #\_\_users WHERE id = ".$result-\>user\_id;  
$database -\>setQuery ($query\_name);  
$usernames = $database-\>loadObjectList();  
foreach($usernames as $username){  
?\>

\<?php  
$profileName = $link.$result-\>avatar.“"border="0" alt="member image"$setwidth$setheight/\>  
\<br/\>$username-\>username\</a\>\</div\>$result-\>hits\<hr/\>  
“;}  
$profile .= “\<div align="center"\>\<a href="index.php?option=com\_comprofiler&task=userProfile&user=”.$result-\>user\_id.”"\>$profileName”;}  
}  
echo $profile;  
echo"\</table\>  
\</center\>";  
?\>

This php script displays the top 20 users from a database based on their hit count. The script passes their avatar (image), username and link, as well as total hits.

I wanted to create a flash file with one movieclip that would parse the php file and display the results in an i++ fashion, so that I could make changes to only one mc instead of 20, when needed.

I have tried making a dynamic text field an mc, and assigning the loadvars object to that mc… but can’t get any information to display… and I know the php file works like a charm.

I have been hitting my head against the wall with this problem for awhile now, and any help would be extremely appreciated!

:jail:

---

<div class="post-metadata">

**Author:** ![red1000](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@red1000](https://forum.kirupa.com/u/red1000)\
**Post date:** [March 26, 2006, 5:42am UTC](https://forum.kirupa.com/t/passing-php-variables-to-flash/180054/2 "2006-03-26T05:42:45Z")

</div>

I’ve been working on this problem for quite awhile now… but I’m still stumped. I am unable to properly use the examples you all have given due to my lack of understanding in the area, and if someone can provide an example that works with the code I posted at the top of this thread, I will gladly give you 20 bucks through PayPal for your time… I really need help with this!

Thanks!

🙂
