I'm having trouble creating variables from $_POST variables dynamically.
On a form, I have a table where people fill out driver information. The table has one row originally, but if more rows need to be added, the user presses a button, a new row is added, and the field names in the new row increment, i.e: driver1, driver2, driver3, driver4.
I'm trying to get this to match up with my PHP script:
$count=1;
while($count<=100) {
$driver . string($count) = $_POST['driver . string($count)'];
$count++;
}
Normally I would create a new variable for each $_POST variable, but in the case of there being up to 100 rows, I'd like to handle this with a loop.
The error I'm receiving is:
Fatal error: Can't use function return value in write context in C:\Inetpub\vhosts\host\httpdocs\process.php on line 11
$driver . string($count) = $_POST['driver . string($count)'];? You have an assignment= $_POST...in the middle of a concatenation.issetcalls...