Im very new to php and have tried to mess with this code I got from someone else, Im trying to create an update page for a very simple photo database, Im kinda stuck as I have been glaring over this the last few days and cant seems to see where im going wrong, I keep getting this error on line 121. wat it should do is pickup the last settings on the populated fields, if not upload the new pic file fields.
Warning: Invalid argument supplied for foreach() in ... line 121.
where I have
if (isset($_POST["op"]) && ($_POST["op"]=="UpdatePhoto"))
{
foreach ($_FILES["PHOTOONE"]["error"] as $key => $error)
{
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES["PHOTOONE"]["tmp_name"][$key];
$name = $_FILES["PHOTOONE"]["name"][$key];
move_uploaded_file($tmp_name, "$ImagePath/".$_POST['PHOTOREF']."-$name");
$PHOTOONE = "".$_POST['PHOTOREF']."-$name";
}
}
can anyone please tell me what Im missing or am doing wrong, much appreciated.