codenamevirus - I do not know much about PHP, so I'm afraid I can't help you. But, something that you could do is that when the user purchases the book, depending on their details give them a username and password (for example if Joe Smith buys your book, username is 'jsmith'. Leave the password to be generated automatically). Then, give them a time limit of 1/2 hours to go to the following page and, using their new username and password, gain access to the book and download it. The username and password expire after 1/2 hours, so nobody else will have enough time to download it. This one would work, but I have no clue how to code it.

Good luck!

-jk