Hi,the following file worked up until the sites went of line last week,but i now get the following error and dont know why
Warning: copy(misc/beutDayPurpleSexyFairyDark.gif) [function.copy]: failed to open stream: Permission denied in /home/******/public_html/addmisc.php on line 24 Couldn't copy file.
<?php include("config.inc.php"); echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html"/> <meta http-equiv="Cache-Control" content="no-cache" forua="true"/> <title>add pic</title></head> <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080"> '; if ($upload="upload"&&$superdat_name){ if (!eregi("\.(gif|jpg|png|jpeg|wbmp)$",$superdat_name)){ print "**Unsuported File extention!!!**"; }else{ $superdat_name = preg_replace( '/[^a-zA-Z0-9\.\$\%\'\`\-\@\{\}\~\!\#\(\)\&\_\^]/' ,'',str_replace(array(' ','%20'),array('_','_'),$superdat_name)); if(strlen($superdat_name)>53){ print "**File Name to long!!!**"; }else{ if (empty($superdat)) { print "**No input file specified!!!**"; }else{ copy("$superdat", "misc/$superdat_name") or die("Couldn't copy file."); } echo "**$superdat_name** has been successfully uploaded"; } } } $result=mysql_query("select * from members where username='$username' and password='$password'"); $number_of_rows = mysql_num_rows($result); if ($number_of_rows>0) echo "<a href=\"welcome.php?username=$username&password=$password\">Main Page</a>"; { ?> <FORM ACTION="addmisc.php?username=$username" METHOD="POST" ENCTYPE="multipart/form-data"> **File to be sent :** <input type="file" name="superdat"> <input type="hidden" name="upload" value="upload"/> <INPUT TYPE=SUBMIT NAME="submit" VALUE="Upload File"> <?}?> </FORM> </body> </html>