Re: checkboxes

From: Date: Fri, 21 Jan 2005 21:31:38 +0000
Subject: Re: checkboxes
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38257@lists.php.net to get a copy of this message
I've tried that and it still doesn't bring over the other checkboxes that have been checked. Plus when I echo it out I get Array instead of the variable name. On Jan 21, 2005, at 3:14 PM, Hutchins, Richard wrote:
Probably all you need to do is name your checkboxes as an array thusly: name="completed[]" Then you can access the array on your update page and do whatever you wish with it. Hope this helps. Rich -----Original Message----- From: Craig Hoffman [mailto:choffman@eclimb.net] Sent: Friday, January 21, 2005 4:03 PM To: php-db@lists.php.net Subject: [PHP-DB] checkboxes I have a form that display's a checkbox if the value is NULL. The form is in a do... while loop, so the user may check multiple checkboxes. I am trying to pass the variable of each checkboxes to an update statement in MySQL. THe problem is I am only getting one of the checkboxes, even if all of them are checked. Here is my code block, any help would be great. - Craig //From form page <form> <input type='checkbox' name='completed' value='Done' > </form> //MySQL Update Page $email = $_POST['email'] == $route; $completed = $_POST["completed"] == $route; $route_name = trim($_POST["route_name"]) == $route; $user_id = $_POST['user_id'] == $route; $id = $_POST['id'] == $route; $route = array(id => "$_POST[id]", completed => "$_POST[completed]", route_name => "$_POST[route_name]", user_id => "$_POST[user_id]");
             foreach ($route as $key => $values) {
                    echo("<br />");
                    echo $values;
                   //MySQL Update statement will go here.
} -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.db (#38257) next »