Store a list of movies somewhere, most likely in a MySQL database (I'm assuming?)
Pass a variable in the URL to your PHP script telling which movie to look for (a unique ID). Grab the filename of this movie from the database, and whack it in an HTML tag. Print the tag.
As for the automatic opening, that's Javascript's field.
That's about the gist of it 🙂