I'm having a problem...
Warning: copy(gallery/): failed to open stream: Is a directory in /home/voodoo/public_html/ndgamers/actions.php on line 1366
Whenever I execute:
if($cmd == "_upload_"){
?>
<table width="95%" border="0" cellspacing="1" cellpadding="0">
<tr> <form action="<? echo("$PHP_SELF?cmd=upload"); ?>" method="post" enctype="multipart/form-data">
<td width="14%"><? echo("$fontString"); ?>File:</font></td>
<td width="86%"><input type=file name=img></td>
</tr>
<tr>
<td><? echo("$fontString"); ?>Catagory:</font></td>
<td><select name="catagory">
<option value>Warhammer 40k</option>
<option value>Magic the Gathering</option>
<option value>Mordhiem</option>
<option value>Battlefield Gothic</option>
</select></td>
</tr>
<tr>
<td><? echo("$fontString"); ?>Description:</font></td>
<td><TEXTAREA rows="6" cols="35" name="description"></TEXTAREA></td>
</tr>
<tr>
<td colspan="2"><br><br><input type="submit" name="submit" value="Upload Now"></td>
<td>
<tr>
</tr></td>
</form>
</tr>
</table>
<?
}
if($cmd == "upload"){
$today = date( "Ymd", time() );
if($img){
echo("
$fontString File Name: $file_name<br>
File Size: $file_size<br></font>
");
if(copy($img, "gallery/$file_name")){
@mysql_query("INSERT INTO gallery SET img = '$file_name', author = '$myrow[username]', description = '$description', date = '$today'");
echo("
$fontString Your file was successfully uploaded!</font><br>
");
}
else{
echo("$fontString There was a problem, your file did NOT upload.");
}
unlink($img);
}
}
Ideas? The directory is CHMOD to 777