# Random Image Load Tutorial // Question

**URL:** <https://forum.kirupa.com/t/random-image-load-tutorial-question/193412>\
**Category:** programming\
**Created:** [July 13, 2006, 5:07am UTC](https://forum.kirupa.com/t/random-image-load-tutorial-question/193412 "2006-07-13T05:07:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maccapug](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@maccapug](https://forum.kirupa.com/u/maccapug)\
**Post date:** [July 13, 2006, 5:07am UTC](https://forum.kirupa.com/t/random-image-load-tutorial-question/193412/1 "2006-07-13T05:07:43Z")

</div>

Greetings, I just read the excellent tutorial on loading a random image in php located [here](http://www.kirupa.com/web/random_image.php)… Is there a way to add an ‘if’ type of statement to this function so that the same image will not load twice in a row? Currently the same image will load 2x in a row if the same random number occurs twice.

Thanks for any help!
