Great question — answering as the UphillTech team:
Building affiliate software is no small undertaking, especially for someone who is new to both PHP and MySQL. You could debate the implementations all day long, but basically the steps for how the program works are something like this: User clicks link You write cookie to user, and redirect that user to the "client." We'll use the term client to refer to the person or company that is actually doing something with your user. You will typically want to add something to the URL since you can't write cookies for a domain the user is not on, and you (or other sites) can not access cookies written for another domain. (This is Browser Security Protocol). After this point, you will need some kind...
Full answer by Jim Rubenstein: https://stackoverflow.stackexchange.com/a/5889583 (CC BY-SA 3.0).
Need it done for your business? UphillTech.