Hey guys,
I keep getting this error:
Undefined variable: picture_type in /blah/blah/script.php
The script is taking a multi-part form field and seems to work except that PHP doesn't know this built-in variable (I thought!)
Here is the bit of code where it is happening:
if ( ('$frm[picture]') && ('$frm[picture]' != "none") ) {
if (!$id)
$id = mysql_insert_id();
$type = basename($picture_type);
switch ($type) {
case "jpeg":
case "pjpeg": $filename = "pictures/$id.jpg";
copy ('frm[$picture]', $filename);
$sql = "update products set picture = '$filename' where id = $id";
$result = mysql_query($sql, $conn);
break;
default: print "Invalid picture format: $picture_type";
}
}
Any ideas?