How to post unknown amount of data ?

From: Date: Wed, 08 Aug 2001 11:00:07 +0000
Subject: How to post unknown amount of data ?
Groups: php.general 
Request: Send a blank email to php-general+get-61792@lists.php.net to get a copy of this message
Hello all, I'm having a trouble. I'm programming an CMS for one pc company. So in example i'm doing a pc category catalog admin. They can add/delete/modify theese category's. But also they want one feature: they want to edit all category's in one form. So i made a form that displays all category's in <input type="text"> so they can edit, but the problem is that i dunno how many there will be category's and how to organize data passing to script. User submits form with all changes, and my script needs to get all theese category's with id's and changed names. Ok how it looks in script: Function display_all() { Print "<form action='category.php' method='post' name='editcat'> <INPUT TYPE=hidden NAME='admin_editall' VALUE='1'>"; $result=mysql_query("SELECT cat_id, cat_name, cat_show FROM cat GROUP BY cat_id ASC"); While ($row=mysql_fetch_array($result)) { $cat_id=$row["cat_id"]; $cat_name=$row["cat_name"]; $cat_show=$row["cat_show"]; Print "<tr class=tb1><td><input type='text' name='cat_id' size='2' maxlength='4' value='$cat_id' disabled></td>\n"; Print "<td><input type='text' name='cat_name$cat_id' size='50' maxlength='50' value='$cat_name'></td> <td><input type='checkbox' name='cat_status'"; if ($cat_show=="Y") {Print " checked";} Print "></td></tr>\n"; } } // ^^^ this form post all data into same file <category.php> //and function add_all_db() must get all data. Function add_all_db(){ ????????? // here i must add theese changes to db // i know how to add to db, but dunno // how to get forms passed data. } PHP Version 4.0.4pl1 MySQL Version 3.22.30 Thank u for your help. Vilius Zigmantas aka vz vz@kryptis.lt

« previous php.general (#61792) next »