Jump to content

More quiz questions


ryy705

Recommended Posts

Hello,

The following questions are from a quiz I took.  I'm not sure about these two questions.  Could someone tell me what the right answers are and why?  Many thanks in advance.

 

Consider the following PHP string representing an SQL statement:

$query = "UPDATE users SET password='$password' WHERE username='$username'";

Which of the following values for $username or $password would change the behavior of this query when executed?


Answer...
None of the above
$username = "foobar\' WHERE username='admin'";
$password = "foobar' WHERE username='admin' --:";
$username = "foobar\' WHERE username='admin'";
$password = "\"foobar\" WHERE username=\"admin\""; 

 

When embedding PHP into XML documents, what must you ensure is true in order for things to function properly?


Answer...
Disabling of the short_tags PHP.ini directive
Enabling the asp_tags PHP.ini directive
That you have XPath support enabled in PHP 5
That your XML documents are well-formed
None of the above, PHP can be embedded in XML in all cases. 

Link to comment
https://forums.phpfreaks.com/topic/133536-more-quiz-questions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.