# Random image showing

**URL:** https://forum.kirupa.com/t/random-image-showing/179346
**Category:** Uncategorized
**Created:** [February 19, 2006, 4:41am UTC](https://forum.kirupa.com/t/random-image-showing/179346 "2006-02-19T04:41:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![fasterthanlight](https://avatars.discourse-cdn.com/v4/letter/f/ecc23a/32.png) [@fasterthanlight](https://forum.kirupa.com/u/fasterthanlight)
#### Post date: [February 19, 2006, 4:41am UTC](https://forum.kirupa.com/t/random-image-showing/179346/1 "2006-02-19T04:41:13Z")

</div>

ok i have a site that needs to switch its header from a directory of several different jpgs randomly everytime the site is loaded.

the script i have in my html page is as follows:

```auto

<?php
    $randInt = rand(1, 8);
    echo "<img src="headerImages/head0" + $randInt + ".jpg">";
?>

```

filepath to an image is headerImages/head02.jpg

this returns the ever popular Parse error… what am i doing wrong??
