Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.