Form submission dynamic

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

Post Reply
inor.y
Forum Newbie
Posts: 6
Joined: Fri Nov 21, 2003 5:42 am
Location: Philippines
Contact:

Form submission dynamic

Post by inor.y »

I am new in PHP.

I use Macromedia Dreamweaver MX for PHP and MySQL.

I have a form that shows rows of record from a database. Each row has a button and a text entry. I wanted to submit the form but cannot determine what row was clicked, how do we do that?

Roni Joven
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Does each of those rows have their own unique ID number within the database?

If so, display that value within your checkbox/whatever and then when you parse the next page, simply make an SQL statement do whatever you wish WHERE id="$id".

Hope it helps.
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post by microthick »

1) You could design your page so that each row is a new form, then have a hidden field called id that contains the unique row identifier.

2) Or, you can creatively give names to those submit buttons, so that they are called submitButton120 then submitButton121, then just parse out the number at the end of the name so you can do your queries properly.
Post Reply