PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
phpchild
Forum Newbie
Posts: 20 Joined: Mon Jul 31, 2006 6:27 am
Post
by phpchild » Fri Aug 11, 2006 4:59 am
hi
i want to display some check boxes with id and i have to pass this id (which i selected ie) 3 check boxes)
it should be pass into the next page. please help me
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Fri Aug 11, 2006 5:12 am
Code: Select all
$ids = range(1, 6);
foreach($ids as $id)
{
echo '<input name="checkboxes[]" type="checkbox" value="'.$id.'" />';
}
then when you have submitted your form, you can access the ids in the checkboxes array
Code: Select all
echo '<pre>';
print_r($_POST['checkboxes']); //or $_GET depending on form method
echo '</pre>';
dotoho
Forum Newbie
Posts: 14 Joined: Tue Aug 08, 2006 5:12 am
Post
by dotoho » Fri Aug 11, 2006 5:13 am
u can writle more clearly what do u want .
I like to disscuss because now i am doing with check box
phpchild
Forum Newbie
Posts: 20 Joined: Mon Jul 31, 2006 6:27 am
Post
by phpchild » Fri Aug 11, 2006 6:02 am
hi
thanks for ur reply.
this code is working. but how i seperate this is ids. because i have to pass this ids to mysql query.
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Fri Aug 11, 2006 6:03 am