Reply to How to have unique id's for POSTing when displaying many table rows?

Your name:

Reply:


Posted by Second_Chance on 10/25/26 11:16

How to deal with multiple records and posting values?
(I'm fairly new to html/php etc. so maybe there is a simple answer?

I have a page showing several records - each table record is contained
within a separate form and has action buttons that submit (for
update/delete etc).

I generate the html using a php loop, which adds the loop counter to
inputs name and id (to ensure unique id's).
This results in the $_POST array receiving results as "budgetname1", or
"budgetname2" etc.

Do I have to parse the POST array, when what i really want is just
"budgetname" in the POST array, no matter which record the user clicks
on (the values tell me what i need!).
Although the page works if I assign the same id's in each form, the HTML
spec seems to suggest that a) id's must be unique in the document, b)
that name and id must be the same, and c) that "[]" characters are not
permitted in HTML 4.01

So do I have to step thru the POST array checking all the keys looking
for a substring match of the key to "budgetname%" or similar??

I guess this must be a common problem with multi-row tables on a page,
but what's the best solution?
thanks
chris

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация