In the following code, which classes can be instantiated?

In the following code, which classes can be instantiated? abstract class Graphics { abstract function draw($im, $col); } abstract class Point1 extends Graphics { public $x, $y; } function _construct($x, $y) { $this->x = $x; $this->y = $y; } function draw($im, $col) { lmageSetPixel($im, $this->x, $this->y, $col); } class Point2...

July 31, 2018 No Comments READ MORE +

What is the name of the function that allows you register a set of functions that implement user-defined session handling?

What is the name of the function that allows you register a set of functions that implement user-defined session handling?A . session_set_handler()B . session_set_storage_handler()C . session_register_handler()D . session_set_save_handler()View AnswerAnswer: D

July 29, 2018 No Comments READ MORE +

Which of the following filtering techniques prevents all cross-site scripting (XSS) vulnerabilities?

Which of the following filtering techniques prevents all cross-site scripting (XSS) vulnerabilities?A . Strip all occurrences of the string <script.B . Strip all occurrences of the string javascript.C . Enable magic_quotes_gpc.D . None of the above.View AnswerAnswer: D

July 25, 2018 No Comments READ MORE +

Which technique should be used to speed up joins without changing their results?

Which technique should be used to speed up joins without changing their results?A . Add indices on joined columnsB . Add a WHERE clauseC . Add a LIMIT clauseD . Use an inner joinView AnswerAnswer: A

July 23, 2018 No Comments READ MORE +

Which of the following will NOT instantiate a Date Time object with the current timestamp?

Which of the following will NOT instantiate a Date Time object with the current timestamp?A . $date= new DateTime();B . $date= new DateTime('@' . time());C . $date= new DateTime('now');D . $date = new DateTime(time());View AnswerAnswer: D

July 20, 2018 No Comments READ MORE +

From your PHP application, how can you send the same header twice, but with different values?

From your PHP application, how can you send the same header twice, but with different values?A . Set the second argument of the header () function to falseB . PHP does that automaticallyC . You may only send a particular type of header onceD . Use the header_add() functionView AnswerAnswer:...

July 15, 2018 No Comments READ MORE +

What is the preferred method for preventing SQL injection?

What is the preferred method for preventing SQL injection?A . Always using prepared statements for all SQL queries.B . Always using the available database-specific escaping functionality on all variables prior to building the SQL query.C . Using addslashes() to escape variables to be used in a query.D . Using htmlspecialchars()...

July 15, 2018 No Comments READ MORE +

What can be said about the call to file_get_contents?

Consider the following code. What can be said about the call to file_get_contents? $getdata = "foo=bar"; $opts= array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $getdata ) ); $context = stream_context_create($opts); $result= file_get_contents('http://example.com/submit.php', false, $context);A . A GET request will be performed on http://example.com/submit.phpB . A...

July 12, 2018 No Comments READ MORE +

Which of the following statements about exceptions is correct? (Choose 2)

Which of the following statements about exceptions is correct? (Choose 2)A . you can only throw classes derived from ExceptionB . a try block can have multiple catch blocksC . a try block must not be followed by a catch blockD . try blocks cannot contain nested try blocksView AnswerAnswer:...

July 11, 2018 No Comments READ MORE +

What is the output of the following code?

What is the output of the following code? var dump(boolval(-1));A . bool(true)B . bool(false)View AnswerAnswer: A

July 5, 2018 No Comments READ MORE +