Hi,
I was given the php scripts for this website and there is an error in the one that allows a user to upload an image file from their computer to a table called "photo" in my website. Below is the code:
?
include("cookie.php");
include("connect.php");
if($Error1==1)
$Error="Size of photo can not be more than 400kb";
if($submit)
{
if($photo=="" || $quote=="")
{
$Error="Incomplete Information";
}
else
{
if($photo_size<=409600)
{
$resmaxid=mysql_query("select max(id) from photo");
$rowmaxid=mysql_fetch_row($resmaxid);
$maxid=$rowmaxid[0];
$PRODUCTIMAGES="photoimage";
$path =$PRODUCTIMAGES."/".$maxid.$photo_name;
$photoname=$maxid.$photo_name;
copy($photo,$path);
if($fromwhere==1)
{
$photoquery="insert into photo(photo,quote,username,main) values('$photoname','$quote','$UsErCoOkIe','Y')";
}
else
{
$photoquery="insert into photo(photo,quote,username,main) values('$photoname','$quote','$UsErCoOkIe','$maxid')";
}
$photoresult=mysql_query($photoquery,$db);
}
else
{
$Error="Size of photo can not be more than 400kb";
}
}
}
if($photoresult)
{
header("Location:message.php?11");
}
$sql="select * from users where identity='$UsErCoOkIe'";
$result=mysql_query($sql,$db);
$row7=mysql_fetch_array($result);
$id=$row7["userid"];
?>
the error says "warning: unable to open 'array' for reading no such file or directory.....on line 24"
line 24 is
copy($photo,$path);
What does this error mean? and any suggestions as to how to fix it please?
Cheers,
Joel