Zend
200-530 · Question #557
You run the following PHP script: <?php $name = mysql_real_escape_string($_POST["name"]); $password = mysql_real_escape_string($_POST["password"]); ?> What is the use of the…
The correct answer is A. It can be used as a countermeasure against a SQL injection attack. C. It escapes all special characters from strings $_POST["name"] and $_POST["password"]. See the full explanation below for the reasoning.
Question
You run the following PHP script: <?php $name = mysql_real_escape_string($_POST["name"]); $password = mysql_real_escape_string($_POST["password"]); ?> What is the use of the mysql_real_escape_string() function in the above script. Each correct answer represents a complete solution. Choose all that apply
Options
- AIt can be used as a countermeasure against a SQL injection attack.
- BIt escapes all special characters from strings $_POST["name"] and $_POST["password"]
- CIt escapes all special characters from strings $_POST["name"] and $_POST["password"].
- DIt can be used to mitigate a cross site scripting attack.
How the community answered
(35 responses)- A77% (27)
- B6% (2)
- D17% (6)
Community Discussion
No community discussion yet for this question.