Undefined index

Posted on 2011-04-26
Last Modified: 2012-08-13
I have a form below which gets some values from mysql and either checks or unchecks a checkbox.

But when I try to pass the value to another page I get the following error.

Notice: Undefined index: pagemanager in C:\wamp\www\order_request.php on line 22

Any help would be appreciated.

<input type="checkbox" name="pagemanager" id="1" value="Order $990" <?php if ($row['pagemanager'] == 1) { ?> checked = "checked" disabled = "disabled" <?php } ?>  class="margincheck"/>

Processing page

Page Manager: " . $_POST['pagemanager'] . "

Open in new window

Question by:Cheryl Lander
    LVL 82

    Accepted Solution

    Page Manager: " . $_POST['pagemanager'] . "

    Page Manager: " . ( isset($_POST['pagemanager']) ?$_POST['pagemanager'] : ''). "...";

    Also, if checkbox IS checked, but it IS diabled, it will NOT be sent to the server. The browser will treat it as if it doesn't even exist.  So if you are expecting a checked item to be detected on the server, make sure it is enabled.


    Author Closing Comment

    by:Cheryl Lander
    Thanks hielo. perfect.

    Also disabled the checkbox...was just in dev.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now