Read it carefully, and note the security issues involved. And as it says, this is university level code.
Are you sure that there are no copyright issues involved? If there are you may well attract a swarm of expensive lawyers.
It is your responsibility to die() if necessary….. - PHP Manual