Great. I finally had the time today to try this script and it works by just pasting the whole thing into my html file. Probably violates every coding praxis there is but it seems to work.
However, it would be less cumbersome if I could have this code in it's own php file and just call it by a simple function call from the html file. How would I do this? I just think it would make the html file more readable.