There are literally thousands of ways to hack a site so without more info there's no way to suggest how to prevent it from happening again. What version of Mambo or Joomla were you running?
__________________ Doyle Lewis - BuyHTTP Internet Services
keliix06 [at] gmail.com
Its hard to tel
it may even be coming not from your website
it can be coming from some other user on the server
but if u set permisions not to be 777 and not as apache / nobody user group
then most likely this wont happn