Web hacked, indexes removed??

Somebody this morning has removed all the index.php from the sections of one of my sites, and replaced them with the attached code, how can i prevent this from happening again, and how could this happen, somoe have access to my folders??

If the hacker was able to access your account and modify your files, then your hosting provider has a serious breach and most likely your data is at risk. I recommend contacting your hosting provider and see if they have had any additional server-side intrusions. I would also send them a copy of the code you found so they can see if they are at risk as well for other sites.

Basically that script reads the website's users IP does something with it that returns a value of go or false(other value) then if the value is go it will submit the website ip address to a database where they can find Vulnerable websites to be use for spyware, spamware, virus Injection & other security related issues.

i suggest you get your host to upgrade their software and security, or move hosts.