[eluser]blackhalobender[/eluser]
How did you guys solve the error problem? Nobody wants the errors in that big long list of <p>s in the top of the form. People generally want the errors to be next to the problem field.
I tried this:
Code:
$data['photo1'] = '';
$data['photo2'] = '';
$data['photo3'] = '';
$data['photo4'] = '';
$keys = array_keys($_FILES);
$errors = array();
$uploads = array();
foreach($keys as $field){
if ( ! $this->upload->do_upload($field))
{
$data[$field] = $this->upload->display_errors('<p class="errors">','</p>');
}
else
{
$uploads = $this->upload->data();
}
}
... but my data array is funky. <?=$field1; ?> works great. But <?=$field4; ?> contains the errors from 1, 2, 3, and 4.
Problemo 2 is that I can't seem to test for the dumb error of: You did not select a file to upload.
I've been on this so long I'm considering hacking the class. I know, bad idea.