Hi Patrick, this should do it.
I took a look at the affiliate page at the site listed in your profile.
If that's not the right site, let me know.
You will open your affiliate.php page in your html editor and make two simple additions.
This is updater proof, so no worries when making future updates.
In the head of the page somewhere, add the following single line
<script language="JavaScript" src="http://www.geoplugin.net/javascript.gp" type="text/javascript"></script>
Next, in the content area of the page, just after the include line for the affiliate code add the following
<script>
var country = geoplugin_countryCode();
var mesg = ('Sorry, our Affiliate program is available in the US only');
if (country != 'US'){
document.getElementsByClassName("ectdivcontainer")[0].style.display='none';
document.getElementsByClassName("ectdivcontainer")[1].style.display='none';
document.getElementsByClassName("ectdiv2column")[0].style.display='none';
document.getElementsByClassName("ectdivhead")[0].innerHTML = mesg;
}
</script>
Ok, a few things to note.
You can change the message in green there to anything you like. - However if your text contains a single quote ' then there will be an error unless we escape that. So let me know if that happens.
Next, we want to test this to be sure it works, right?

Being that you are in the US, you should not see anything happen at all when you upload the new page and visit your affiliate page.
So what you are going to do it change the part in red there and check the page.
What we have there currently is the "
!=" and in Javascript, that is saying "not equal to".
Basically my "if" statement there just says if the country of the visitor is not US then do some stuff.
That "stuff" is going to hide the affiliate form and we are going to replace the text at the top of the page with a message.
So I want you to change the
!= to
== and then upload the page. and visit the affiliate page. You may need to refresh the browser.
Now we are saying if the country IS US, then do that stuff, and you should see what a NON US visitor will see.
Once you confirm it's working, then change the code back to
!= and upload.
Keep in mind that it's possible to spoof an IP address so you may see the occasional signup from a foreigner but you can just ignore them and delete, because you can be sure they are spoofing their IP or defeated our little trick here, and they can probably not be trusted anyway.
Let me know how you get along and if you have issues or questions.
I can't really test this myself, but it should work perfectly.
David