Question: Consider the following: SQL Injection and cross-site scripting are typical security attacks carried out against web applications. Study the php document given below in Figure

Consider the following: SQL Injection and cross-site scripting are typical security attacks carried out against web applications. Study the php document given below in Figure 5 and answer the following questions. Figure 5 TI = connect_error) { die ("Connection failed: " . $conn->connect error); } $query = "select * from user where uname='$_POST[uname]' AND upass='$_POST[upass]'"; $result $conn->query($query); } ?> Rewrite the Figure 5 code to prevent these types of security attacks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
