If you could help me out, it'd be great.
Basically, I'm trying to create a script that checks the values of a submitted forum, where the number of fields are dynamically created with a while loop (user selects from 1-10).
Each value is...
<input type="file" name="file_1">
<input type="file" name="file_2">
etc... , depending on how many fields the user decides to select.
screen_number is a hidden input on the page that stores the number (1-10) that the user has selected.
On the next screen, I want to create a while loop to check to see if the values of the dynamically created form are filled in.
The latest version of it is this...
if ($action == "upload") {
$num = "1";
while ($num <= $screen_number) {
$sourcefile = { "file_" . $num };
$$sourcefile = $sourcefile;
if (!isset($sourcefile)) {
$file_check = "0";
}
$num++;
}
[more code]
}
which gives a parse error, and wouldn't work anyway even if it didn't give a parse error 🙁
I need "$sourcefile" to be set as a variable "$file_1", "$file_2", etc, but NOT the value of the that variable... the value will be from the form.
If that doesn't make sense, it's basically a dynamic version of this
if (!isset($file_1)) {
$file_check = "0";
}
Thank you!