# Help Me!

**URL:** https://forum.kirupa.com/t/help-me/28034
**Category:** Uncategorized
**Created:** [August 9, 2003, 2:48am UTC](https://forum.kirupa.com/t/help-me/28034 "2003-08-09T02:48:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![TecFreak](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tecfreak/32/218_2.png) [@TecFreak](https://forum.kirupa.com/u/TecFreak)
#### Post date: [August 9, 2003, 2:48am UTC](https://forum.kirupa.com/t/help-me/28034/1 "2003-08-09T02:48:28Z")

</div>

```php
<?php 
$dh = opendir("."); 
while (false !== ($file = readdir($dh))) 
{ 
if (preg_match('/.jpg$/i', $file) and $file != "signature.jpg") 
{ 
$filelist[] = $file; 
} 
} 

srand((double)microtime()*1000000); 
$picnum = rand(0, sizeof($filelist) - 1); 

header("Location: " . $filelist[$picnum]); 

closedir($dh); 
?>

```

tell me what’s wrong with this image rotator that doesn’t want to work!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2003, 3:24am UTC](https://forum.kirupa.com/t/help-me/28034/2 "2003-08-09T03:24:42Z")

</div>

what is it doing exactly? because if you want it to just go to a random image everytime the PHP script is accessed, then it works fine…

I copied and pasted the script onto my server and it works fine. PHP version 4.3.2
