Hello, lately I have been working on a shop system for website, all is fine until it comes to uploading things, here’s my code:
[php]
Nicron / Upload item"; } else {
if (file_exists("upload/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"avatars/" . $_FILES["file"]["name"]);
echo "Stored in: " . "avatars/" . $_FILES["file"]["name"];
echo "Item awaiting approval!";
mysql_query("INSERT INTO oitems VALUES('$iname', '$idesc', '$price', 'http://nicron.x10.mx/avatars/' . $_FILES[file][name], '$_SESSION[username]')");
}
}
}
else
{
echo “Invalid file”;
}
}
else{
?>
Price:
Description:
<?php } ?>
Return [/php]
The file uploads, but the script refuses to write to the database.
Thanks for any help!