[SOLVED] An array variable in a POST function? Dunno.
Posted: Sun Oct 02, 2005 3:34 pm
Okay I have this variable, $price[f]. How do I put that into a POST function (if that's what it's even called).
I tried $_POST[price[f]], $_POST['price[f]'], $_POST["price[f]"], why won't any work??
*EDIT* Basically it's a form with a changing amount of multiple values.
i.e.
and on the next page (after hitting the submit button) it edits a value in the DB for each one....
Thanks in advance for any help,
Covenant
[/b]
I tried $_POST[price[f]], $_POST['price[f]'], $_POST["price[f]"], why won't any work??
*EDIT* Basically it's a form with a changing amount of multiple values.
i.e.
Code: Select all
<input type=text name=price[1]>
<input type=text name=price[2]>
<input type=text name=price[3]>
<input type=text name=price[4]>
<input type=text name=price[5]>Code: Select all
$ep=mysql_query("SELECT * from members where name='$name[user]'");
while($row = mysql_fetch_array($ep)) {
$f=$row[id];
$p=$_POST['price[$f]'];
mysql_query("UPDATE members set price=$p where id='$f'");
}Covenant