Now a day’s computers are widely used for web application. Majority of transactions are done online these days. Thus data from web server and database server are prone to be hacked easily which relies to provide more security to web applications. Hacking is the gaining of access(wanted or unwanted) to a computer without the intention of destroying data or maliciously harming the computer. To overcome this issue DoubleGuard system is used.By monitoring both web and subsequent database requests, we are able to ferret out attacks that an independent Intrusion Detection System (IDS) would not be able to identify. IDS is used in DoubleGuard system to detect & prevent attacks. By using mapping of request and query IDS system can provide security for both web server and database server. The network behavior of user sessions across both the front-end web server and the back- end database is modelled by an IDS system. By isolating the flow of information from each web server session the DoubleGuard system solves the problem.