Posted by Alliss on 10/12/05 11:38
I have a dynamically generated form which produces a series controls like
these.
<input type='submit' name='lastName[]' value=' Brown '>
<input type='submit' name='firstName[]' value=' Bill '>
I end up with about 90 elements in each array.
I submit the form using
<form method="post" action ="<?php echo $PHP_SELF ?> " >
After the form is submitted and I test to find the values in the arrays they
are empty.
I want to be able to insert the individual values from the arrays into a
database table.
I have tried numerous ways to do this but this will give you an idea of what
I am aiming for:
(the value of $insertData is the number of elements in the arrays coming
from the form)
if($insertData){
for($n=0; $n<$insertData; $n++){
$sql = "INSERT INTO contacts (lastName,firstName) VALUES
('$lastName[n]','$firstName[n])";
...
I would be grateful if someone can tell me how I should be submitting and
then reading the values of lastName and firstName.
Al
[Back to original message]
|