I'd be happy to help. You are allowed to buy an ebook and then lend it to someone else. Here is information from oreilly.com on this:
"Lending: If you buy an O'Reilly ebook from oreilly.com, you may lend it to another person, provided that you do not retain any copies of the book after you lend it. This is the same as the situation when you lend a used print copy—when you lend the copy, you deliver it to the buyer and no longer have a copy in your library. If you have bought a hard copy/ebook bundle, you may of course retain the hard copy, if you lend the ebook."
Another way of doing this is have the recipient create an O'Reily account, and after you purchase the ebook call or e-mail us at firstname.lastname@example.org, and provide us with the e-mail of their O'Reilly account. We will then deposit that ebook into their account.
More information in usage of ebook usage can be found here: http://shop.oreilly.com/category/cust.... Hope this helps and have a great day!
Customer Service Representative