php mcq questions with answers


                                
What is the name of the method that can be used to provide read access to virtual properties in a class?
A.__call()
B.__get()
C.__set()
D.__wakeup()
E.__fetch()
                                
Webservices are primarily meant to support
A.business-to-business communication
B.machine-to-machine interaction
C.improved accessibility for websites
                                
What visibility denies access to properties and methods outside of the class?
A.static
B.protected
C.private
D.public
E.const
                                
Identify the security vulnerability in the following example: <?php mail('feedback@example.org', 'Feddback', 'Here is my feedback.', "From: {$_COOKIE['email']}"); ?>
A.Remote Code Injection
B.Cross-Site Request Forgeries
C.Email Injection
D.None of the above
                                
Identify the security vulnerability in the following example: <?php echo "Welcome, {$_POST['name']}."; ?>
A.SQL Injection
B.Cross-Site Scripting
C.Remote Code Injection
D.None of the above