Slideshow making - dir problem

Hi I like your php script but I realy miss the slideshow. So I tried to make it my self but I need to know how to get a directory in my adress....

Look this is how it works:
I got under my photo's a link that says: Slideshow
It goes to this adress:
phpslideshow.php?directory= (and here it needs to know the dir it's gonna read the photo's)

I all ready got this with the php code....
http://*******.**/album-photos/phpslideshow.php?directory=<? print $dir['name']; ?>

Then the slideshow works... But when I go tro more then 1 dir the php code doesn't work..... because it only says the map name of 1 dir....


I tried someother codes but they all don't work.... Do you know a way to get only the adres of the dirs????