ryy705 Posted November 20, 2008 Share Posted November 20, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/133536-more-quiz-questions/ Share on other sites More sharing options...
.josh Posted November 20, 2008 Share Posted November 20, 2008 We don't do people's homework for them. Thread closed. Quote Link to comment https://forums.phpfreaks.com/topic/133536-more-quiz-questions/#findComment-694570 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.