why do I get undefined 'success_message' in chapter 11 php & mysql MM

Undefined index: SUCCESS_MESSAGE in C:\xampp\htdocs\phpMM\ch12\show_users.php on line 39
this is line 39:
page_start("Current Users", $delete_user_script,
$_REQUEST['SUCCESS_MESSAGE'], $_REQUEST['ERROR_MESSAGE']);
1 person has
this question
+1
Reply
  • Hello Ken,

    I have forwarded your question on to our Book Tech staff, so they can help you find a solution. If you ever have any questions or issues with the content of a title, you can also contact them directly at booktech@oreilly.com or call them at:

    1-800-889-8969
    or
    1-707-827-7019 (outside the USA)
    7:30 am to 5:00 PST

    Kind regards,
    Paul Fichera
    Customer Service Representative
    O'Reilly Media
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • Hi Ken,

    Could you provide some more information about your problem? Can you give me a page number of the example you are trying? You mentioned a problem with Chapter 11, but the file you are using above is in the Chapter 12 folder.

    It sounds like your show_users.php file is dependent on another file that defines SUCCESS_MESSAGE and I can see that is defined in the view.php file in the scripts folder.

    Best regards,
    Chris Olson
    O'Reilly Book Support
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • I was working up to the end of ch11 and got the errors. So I took the download for the start of ch12 from your site to see if maybe I had created some error along the way but your sample code for the start of ch12 gave me the same errors. I am following the book completely, even started over in ch11 but same result. How do I move forward.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • Hi Ken,

    Are you sure that you created the view.php file that is shown on page 368, and are you sure that the php file you are running includes the line -
    require_once 'view.php';
    at the beginning of it? That is where SUCCESS_MESSAGE is defined, so without that you'll get the undefined error above.

    If that doesn't help, send your response to booktech@oreilly.com and we can go from there.

    Best regards,
    Chris Olson
    O'Reilly Book Support
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited

  • Ken-

    $_REQUEST['success_message'] is pulling a request parameter, so it's going to look in your URL for something like:

    show_users.php?success_message=Your%20message%20here

    So a few things:

    1. The code on p. 356 shows (correctly) that success_message should be lowercase, rather than SUCCESS_MESSAGE as in your message. I'd check that first. Follow this through to p. 379 where page_start is called from show_users.php, and you'll see the same. So check your case, first of all.

    2. This is a particularly tangly bit of code through here; lots of refactoring. So I'd try the code at the end of Chapter 11 from the downloads. That's known to work.

    Let us know if you have further issues.

    Thanks
    Brett
    Author
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited