Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

how to get value from CHECKBOX

Links for php scripts

Moderators: macek, egami, gesf

how to get value from CHECKBOX

Postby exoskeleton » Mon Jun 25, 2012 1:33 am

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...
exoskeleton
New php-forum User
New php-forum User
 
Posts: 7
Joined: Mon Jun 25, 2012 1:21 am

Re: how to get value from CHECKBOX

Postby HvWinkel » Mon Jun 25, 2012 6:54 am

Use

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

as URL and separate later.

Good luck.
HvWinkel
New php-forum User
New php-forum User
 
Posts: 8
Joined: Thu Nov 10, 2011 2:36 pm

Re: how to get value from CHECKBOX

Postby HvWinkel » Mon Jun 25, 2012 6:57 am

Forgot the quotes:

" http://localhost:82/delete.php?emp_id=5,12&Submit=Delete "
HvWinkel
New php-forum User
New php-forum User
 
Posts: 8
Joined: Thu Nov 10, 2011 2:36 pm

Re: how to get value from CHECKBOX

Postby HvWinkel » Mon Jun 25, 2012 6:59 am

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
HvWinkel
New php-forum User
New php-forum User
 
Posts: 8
Joined: Thu Nov 10, 2011 2:36 pm

Re: how to get value from CHECKBOX

Postby egami » Mon Jun 25, 2012 8:30 am

Select the checkbox at the bottom of your post "Do Not Automatically Parse URLs" and they won't show up as links.
User avatar
egami
php-forum GURU
php-forum GURU
 
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: how to get value from CHECKBOX

Postby exoskeleton » Mon Jun 25, 2012 7:13 pm

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
exoskeleton
New php-forum User
New php-forum User
 
Posts: 7
Joined: Mon Jun 25, 2012 1:21 am

Re: how to get value from CHECKBOX

Postby Gurinder19904456 » Mon Jun 25, 2012 10:37 pm

You can not use same name for two <a href="http://gurindersinghdeveloper.blogspot.in/">parameters</a>.change it.
Gurinder19904456
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Jun 25, 2012 10:29 pm

Re: how to get value from CHECKBOX

Postby exoskeleton » Mon Jun 25, 2012 11:21 pm

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...
exoskeleton
New php-forum User
New php-forum User
 
Posts: 7
Joined: Mon Jun 25, 2012 1:21 am

Re: how to get value from CHECKBOX

Postby HvWinkel » Sun Jul 01, 2012 8:32 am

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.
HvWinkel
New php-forum User
New php-forum User
 
Posts: 8
Joined: Thu Nov 10, 2011 2:36 pm


Return to PHP Scripts

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron