CS310 Quiz 2 Solution and Discussion

Use …… to add table in the database
400e9f0b-b647-4f63-9b6b-cd1c2d8011d0-image.png

Which of the following PHP function is used to validate and sanitize the data?

13124763-0ebd-4cd5-b247-eafeb3549a8e-image.png

In PHP, in order to access MySQL database you will use:
d5906239-9553-40a9-980c-d058f7441e37-image.png

Which of the following PHP syntax is used to remove all illegal characters from a URL?

08599c0a-7636-43b5-8fd6-115cd16c6eec-image.png

_______ statement is used to add a new record to a MySQL table

d67192ba-7d16-406f-af74-00d00b7918b8-image.png

How will we retrieve the value of session variable set in the following PHP code?
$_SESSION[“color”] = “green”;

448ac04c-61a2-4da2-a13b-0de162c95fc6-image.png

Which of the following PHP syntax is used to remove all HTML tags from a string? CS310
6732c0fa-a97e-46bd-8cce-7a938fa8db76-image.png

If we want to show all the session variable values for a user session then following code will be used.

print_r($_SESSION);

12e46637-e0cf-4b8a-8e09-eb0600a3614b-image.png