Zend
ZF-100-500 · Question #30
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_…
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 s olution. 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
(60 responses)- A75% (45)
- B8% (5)
- D17% (10)
Community Discussion
No community discussion yet for this question.