# Loading a Random Image into flash using php

**URL:** <https://forum.kirupa.com/t/loading-a-random-image-into-flash-using-php/203014>\
**Category:** flash\
**Created:** [October 6, 2006, 3:53pm UTC](https://forum.kirupa.com/t/loading-a-random-image-into-flash-using-php/203014 "2006-10-06T15:53:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_chris](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mr\_chris](https://forum.kirupa.com/u/mr_chris)\
**Post date:** [October 6, 2006, 3:53pm UTC](https://forum.kirupa.com/t/loading-a-random-image-into-flash-using-php/203014/1 "2006-10-06T15:53:03Z")

</div>

Hello there,

I’m having trouble loading in my random images into flash.  
I’m using this tutorial: [http://www.kirupa.com/web/random\_image.php](http://www.kirupa.com/web/random_image.php)

This is how I’m loading the php page into flash:  
header.loadMovie(“[http://216.122.147.9/mmm/header\_images\_array.php](http://216.122.147.9/mmm/header_images_array.php)”);

The activity viewer says the file (header\_images\_array.php) is loading in fine,  
but the loaded images don’t appear in the flash movie.

This is the php page code:  
\<?php  
$file\_array = array  
(‘[http://216.122.147.9/mmm/header\_images/md\_header\_chris\_skate.jpg](http://216.122.147.9/mmm/header_images/md_header_chris_skate.jpg)’,  
‘[http://216.122.147.9/mmm/header\_images/md\_header\_clouds.jpg](http://216.122.147.9/mmm/header_images/md_header_clouds.jpg)’,  
‘[http://216.122.147.9/mmm/header\_images/md\_header\_rink.jpg](http://216.122.147.9/mmm/header_images/md_header_rink.jpg)’);  
$total = count($file\_array);  
$random = (mt\_rand()%$total);  
$file = “$file\_array[$random]”;  
print("\<img src=$file\>\</a\>");  
?\>

Can anyone give me some thoughts on this?

Thanx!
