Posts: 106
Location: South Wales, UK
|
Hey all!
My script was running fine since I made it until today. One minute it was working, the next, it wasn't.
Can anyone help?
Here is the error:
Warning: copy(pics/Manson5C990.jpg): failed to open stream: Permission denied in /home/excessti/public_html/index.php on line 191
And the code:
PHP Code:
case 6:$file="myphotos.php";
include("checksession.php");
if(isset($addpic))
{
$approved=getSetting("APPROVEPIC");
if(!empty($url))
{
$sql="insert into photos(url,filename,username,upldate,approved) values('$url','$filename','$ses_username',now(),'$approved')";
$res=mysql_query($sql);
}
else if(!empty($uppic_name))
{
$allowable=getSetting("ALLOWEDFORMATS");
$allowablearr=split(",",$allowable);
$allowedType=0;
$ext=strchr($uppic_name,".");
if(in_array($ext,$allowablearr))$allowedType=1;
if($allowedType==1)
{
$fileid = generateShortCode();
$filename = $ses_username.$fileid.$ext;
$copytofile="pics/$filename";
copy($uppic,$copytofile);
@unlink($uppic);
$sql="insert into photos(url,filename,username,upldate,approved) values('$url','$filename','$ses_username',now(),'$approved')";
$res=mysql_query($sql);
}
else
{
@unlink($uppic);
$uperror="Format not supported!";
}
}
if($approved=="Y")
{
$error="Image has been added.";
}
else if($error=="")
{
$error="Image is awaiting approval.";
}
}
break;
line 191 is "copy($uppic,$copytofile);"
any help would be great!
Manson
|