Hi a [tricky] bit of php code...
I have a number of variables past from a form called;
txtCatalogue1
txtCatalogue2
txtCatalogye3
These are text boxes. I want to get the contents of each of these text boxes in a loop.
I want the code, to be able to handle the adition of new textboxes using the same convention.
Therefore, I want code to loop and get the variable txtCatalogue{i} where i is a counter variable.
So How can I create a variable name dynamically?
I sort of guest this code, but it doesn't work. Any ideas?
$i=0; // initialise counter variable
while ($txtCatalogue{$i} != ""){ // FOR EACH catalogue do
if ($txtCatalogue{$i} == "request"){ // if requested, write request in email
print $i; // print count variable if txtcataloguei equals request
} // end of if
$i++; // inc counter variable
} // end while
Any help apriciated.
Luke Tudor.