Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi guys, having finished Chapter 13 find myself at the Review section.

 

I'm having trouble answering the following two review questions:

 

How would the is_administrator() function be called to check for the same cookie - named Samuel - with a different value? A different cookie - not named Samuel - with a different value? I'm still unsure about this please help!

 

AND

 

What would be some other good ideas for user-defined functions wit this site? Hint: look for repeated code. Would printing an error message be viable for a function as this seems to be repeated a lot in the code throughout the project? What other ones could there be?

 

Thanks

Link to post
Share on other sites
How would the is_administrator() function be called to check for the same cookie - named Samuel - with a different value? A different cookie - not named Samuel - with a different value? I'm still unsure about this please help!

 

I don't have the book in front of me, but I think I was just looking for:

is_administrator('Samuel', 'some other value');

and

is_administrator('charlie', 'chaplin');

 

What would be some other good ideas for user-defined functions wit this site? Hint: look for repeated code. Would printing an error message be viable for a function as this seems to be repeated a lot in the code throughout the project? What other ones could there be?

 

Yes, printing error messages could be. Or a function for creating form inputs (I *think* I had one in this book in an earlier chapter). Or you could create the quote form using a function (this would be a bit more complex), so that the same form could be used to add or edit a quote.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...