Zend
200-530 · Question #1
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 escapes all special characters from strings $_POST["name"] and $_POST["password"]. B. It can be used as a countermeasure against a SQL injection attack. 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 escapes all special characters from strings $_POST["name"] and $_POST["password"].
- BIt can be used as a countermeasure against a SQL injection attack.
- CIt can be used to mitigate a cross site scripting attack.
- DIt escapes all special characters from strings $_POST["name"] and $_POST["password"]
How the community answered
(41 responses)- A78% (32)
- C17% (7)
- D5% (2)
Community Discussion
No community discussion yet for this question.