someone tell me why this function will not upload the files giving me this error:
// Warning: Unable to open '' for reading: Permission denied in localfiles/pictureupload.dat on line 45
Could not copy file
Fatal error: Call to undefined function: myslq_query() in localfiles/pictureupload.dat on line 54 //
function write_upload(){
global $userid(username), $name(piece name),$directory(directory to be copied into), $description(some text), $file(upload file path), $preview(second upload file), $maxfilesize(pretty obvious), $success(if upload was successful, needed outsite the function), $loggedin(check to see if loggedin), $type1(some text), $type2(some text); - (quotations not in code, just for explanation)
$writefile=basename($file);
if(empty($file)) echo " No file to upload ";
if(empty($preview)) $preview="$file";
if(empty($type2))$type2='NA';
$writepreview=basename($preview);
$location1="pictures/$writefile";
$location2="pictures/$writepreview";
if (!(copy($userfile, '$directory/$writename'))) echo "Could not copy file";
else { $doupload="yes"; }
$usersizefile=filesize($file);
if($usersizefile > $maxfilesize) echo "Sorry, uploaded file size is too big, limit number_format($maxfilesize) mb";
if ($doupload="yes")
myslq_query("INSERT INTO uploads VALUES (\"$userid\",NULL,\"$name\",\"$description\",\"$location1\",curdate(),\"0\",\"0\",\"0\",\"$location2\",\"$type1\",\"$type2\")");
}