i finally got it working, figures after 3 weeks and i finally ask for help, the solution came to me... its that the way it always works out.. lol
the problem was the way i was grabbing the cookie and also the var i was using was being reset by another file that i didnt catch..

if anyone needs a good affiliate program for their website i have one now. the software is free (open source) but ill have to charge a small fee to set it up for ya if you want, because i had to make a bunch of fixes to get it to work the way i wanted.
it counts new visits
it counts repeat visits (unique)
and if someone registers on your site it will give the affiliate credit for that.
i pay on registrations not upgrades.
i still have some minor details to do mostly visual.. but im happy i finally got it working the way i want...
if you want it shoot me a pm as i may not see your reply here for a bit... thanks