这是我的代码中有错误的行:
$filename = str_replace(' ','-',$HTTP_POST_FILES['thumbimg']['name']);
if ($filename != "") {
$valid = 0;
$temp = explode('.',$filename);
$filetype = $temp[count($temp)];
foreach ($imageFileType as $ext) {
if ($filetype == $ext) {
$valid = 1;
}
}
if ($valid = 0) {
$error .= "<li>File is not a valid image.</li>";
}
$filesize = str_replace($HTTP_POST_FILES['thumbimg']['size']);
if ($error == "" ) {
copy($HTTP_POST_FILES['thumbimg']['tmp_name'], $showPathAdmin.$sID.'/'.$filename);
$query = "UPDATE `shows` SET `thumbnail` = '$filename' WHERE sID = '$sID' ";
mysql_query($query) or die('Error, query failed'.mysql_error());
}
}
foreach($_POST['castdelete'] as $deletecast){
unlink($showPathAdmin.$sID.'/'.$deletecast);
}