you need to insert a bit of code on the confirmation page, e.g. <img src="https://www.example.com/affiliate_sale_tracker.php?var1=&var2=&var3="> where var1, 2 and 3 contain for example the order number, the total amount and any other var you wish to record.
you'll also need to have some sort of check to ensure that each order number is only credited once to each affiliate.
i've done this myself and use the software on our own site. however... it is difficult and you also need a backend for affiliates to check sales and it must be rock solid and secure - otherwise you'll never get affiliates to trust you.
all big companies use js script tag instead of php in img src, because js is platform independent. on my own server i am able to use php, so i used the method above.