How to prevent my site for hacking?

That is a very lengthy subject.

http://arstechnica.com/security/2013/02/securing-your-website-a-tough-job-but-someones-got-to-do-it/

http://www.creativebloq.com/web-design/website-security-tips-protect-your-site-7122853

http://web.appstorm.net/roundups/self-publishing/15-great-ways-to-secure-your-website/

I would recommend you start reading the various topics on website security, because we would just be regurgitating the information that already exists.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.