How to get paypal "buy now" button to communicate with my site

So I’m at paypal making a buy now button for my site. I am looking at advanced variables, but I am unsure how to tell my website what the user has bought and that it was successful so it can make the changes in my db. I need to pass on like the userid or something, any hints?