You have register as an affiliate with those companies. You can register for Amazon on their website. Go to the bottom and click on "Join Associates". For ebay, go to the bottom of the page and click on "Affiliates". You will be forwarded to the Ebay Partner Network.
You can help the HubPages community highlight top quality content by ranking this answer up or down.