This bachelor thesis explains the security risks of web applications and their defense against damaging attacks. The issue is presented mostly from perspective of developers, therefore the introduction also mentions several principles of safe behavior on the internet from the user's perspective. Explained are the concepts of security risks in information technology and the concept of web applications. Thesis is based on the project OWASP Top 10 - 2013 made by OWASP Foundation, which defines the ten most critical security threats. There are explained also security methods of defending against some of the threats in the three most widely used PHP frameworks. The practical part presents examples of various attack scenarios of each security thr...