PHP Security
PHP Security - Important Points
16. | What is the purpose of the password_verify() function in PHP? |
---|
A. To encrypt data before storing it in a database
B. To hash passwords before storing them in a database
C. To validate user input
D. To convert special characters to HTML entities
View Answer Discuss Work SpaceAnswer: option c
Explanation:
17. | What is a SQL injection vulnerability? |
---|
A. A vulnerability that allows an attacker to execute arbitrary code on a system
B. A vulnerability that allows an attacker to include a file from a remote server
C. A vulnerability that allows an attacker to bypass authentication
D. A vulnerability that allows an attacker to manipulate database queries
View Answer Discuss Work SpaceAnswer: option d
Explanation:
18. | Which of the following is a method to prevent SQL injection vulnerabilities in PHP? |
---|
A. Using SSL encryption
B. Storing passwords in plaintext
C. Allowing unlimited login attempts
D. Using prepared statements and parameterized queries
View Answer Discuss Work SpaceAnswer: option d
Explanation:
19. | What is the purpose of the session_regenerate_id() function in PHP? |
---|
A. To regenerate the session ID
B. To destroy the session
C. To validate user input
D. To convert special characters to HTML entities
View Answer Discuss Work SpaceAnswer: option a
Explanation:
20. | Which of the following is a method to prevent session hijacking attacks in PHP? |
---|
A. Storing session IDs in plaintext
B. Using a fixed session ID
C. Using SSL encryption
D. Disabling session IDs
View Answer Discuss Work SpaceAnswer: option c
Explanation: