thank you for your response. I got much further than before
However, I've got a second problem now... If you take a look at the sample script as posted on the top, if you click on the link on the page, it will take you directly to the script where it would generate the thumbnails...
I don't want it to be that complicated yet. I want it to just simply go to the index.html or index.php in the directory if I decide to click on the link given. If there's no index page, it would say returning to scripting 2 seconds and refresh.
How do I do that? My script is currently unable to do so yet.