Page 1 of 1

how to get value from CHECKBOX

Posted: Mon Jun 25, 2012 1:33 am
by exoskeleton
hi guys.. need help about check box..

i have 10 records showing in a table and want to delete more than 1 record...
each rows have checkbox to be checked if you want to delete this record.
if i checked more than 1 record of course the url will look like this

" http://localhost:82/delete.php?emp_id=5&emp_id=12&Submit=Delete "

how can i get the value of emp_id where they have the same name (emp_id)?

$emp_id = $_GET['emp_id'] will only get 1 value.. that is my problem...

Re: how to get value from CHECKBOX

Posted: Mon Jun 25, 2012 6:54 am
by HvWinkel
Use

http://localhost:82/delete.php?emp_id=5,12&Submit=Delete

as URL and separate later.

Good luck.

Re: how to get value from CHECKBOX

Posted: Mon Jun 25, 2012 6:57 am
by HvWinkel
Forgot the quotes:

" http://localhost:82/delete.php?emp_id=5,12&Submit=Delete "

Re: how to get value from CHECKBOX

Posted: Mon Jun 25, 2012 6:59 am
by HvWinkel
Sorry, it's my first reply on this forum.

I do not want a link. I want to show this textline: ?emp_id=5,12

Re: how to get value from CHECKBOX

Posted: Mon Jun 25, 2012 8:30 am
by egami
Select the checkbox at the bottom of your post "Do Not Automatically Parse URLs" and they won't show up as links.

Re: how to get value from CHECKBOX

Posted: Mon Jun 25, 2012 7:13 pm
by exoskeleton
HvWinkel wrote:Use

http://localhost:82/delete.php?emp_id=5 ... mit=Delete

as URL and separate later.

Good luck.
thanks sir... ahmm any codes how to do this submitting more than 1 value to same variable?
thanks in advance

Re: how to get value from CHECKBOX

Posted: Mon Jun 25, 2012 11:21 pm
by exoskeleton
Gurinder19904456 wrote:You can not use same name for two <a href="http://gurindersinghdeveloper.blogspot.in/">parameters</a>.change it.
ok... ahmm how can i submit a form to make the url looks like this sir

" http://localhost:82/delete.php?emp_id=5,12,14,15,16,17&Submit=Delete "

any help everyone ... pls...

Re: how to get value from CHECKBOX

Posted: Sun Jul 01, 2012 8:32 am
by HvWinkel
I'm not sure if I understand how your process is working, but if you know how to get
"http://localhost:82/delete.php?emp_id=5&Submit=Delete"
then it is easy ot create
"http://localhost:82/delete.php?emp_id=5,12,14,15,16,17&Submit=Delete".

You should not think in multiple values, but in "strings": "5" is a string like "5,12,14,15,16,17".

If this is not your hangup than you should provide a piece of your code.