[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 384
  • Last Modified:

Undefined index

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.
Form 
-------------------------------------

<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

0
Cheryl Lander
Asked:
Cheryl Lander
1 Solution
 
hieloCommented:
change:
Page Manager: " . $_POST['pagemanager'] . "

to:
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.

0
 
Cheryl LanderAuthor Commented:
Thanks hielo. perfect.

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

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now