# Using PHP for random image on HOME PAGE

**URL:** <https://forum.kirupa.com/t/using-php-for-random-image-on-home-page/199885>\
**Category:** programming\
**Created:** [September 7, 2006, 1:35am UTC](https://forum.kirupa.com/t/using-php-for-random-image-on-home-page/199885 "2006-09-07T01:35:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AntoineArt](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@AntoineArt](https://forum.kirupa.com/u/AntoineArt)\
**Post date:** [September 7, 2006, 1:35am UTC](https://forum.kirupa.com/t/using-php-for-random-image-on-home-page/199885/1 "2006-09-07T01:35:31Z")

</div>

After many months of wondering how and even after making a few failed attempts, I have finally learned how to load a random image using PHP -Thanks to kirupa’s excellent article ([http://www.kirupa.com/web/random\_image.php](http://www.kirupa.com/web/random_image.php)) _doing my happy dance!_ :chinaman:  
Here it is exactly as I wanted: [http://www.antoineart.com/index.php](http://www.antoineart.com/index.php) (first image)

BUT NOW: How do I get that onto my home page ([AntoineArt.com](http://AntoineArt.com))? In order for that page to display as my home page I need to name it index.html… but if I change the .php to .html the code does not work anymore :diss:

Advice would be appreciated!
