PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
// Create the file name.
$extension = explode ('.', $_FILESї'upload']ї'name']);
$filename = $ref . '.' . $extensionї1];
// Move the file over.
if (move_uploaded_file($_FILESї'upload']ї'tmp_name'], "/home/server/public_html/trial/images/")) {
//increase the number of songs uploaded
$numupload = $numupload + 1;
$query = "UPDATE user SET numupload='$numupload' WHERE useracc={$_SESSIONї'useracc']}";
$result = @mysql_query ($query); // Run the query.
echo '<p>The file has been uploaded!</p>';
exit();
} else {
echo '<p><font color="red">The file could not be moved.</font></p>';
exit();
}
is there anything wrong with this upload code??
coz when i run it, i get an error message like this
"
Warning: move_uploaded_file(/home/server/public_html/trial/images/): failed to open stream: Is a directory in /home/server/public_html/trial/uploadsong.php on line 61
Warning: move_uploaded_file(): Unable to move '/tmp/phpavgk3i' to '/home/server/public_html/trial/images/' in /home/server/public_html/trial/uploadsong.php on line 61 "
can someone help me??
sorry to bother u but the same error message still comes out... is it something to do with my server setting???? my server is with nocster and i am using cpanel... i read somewhere that there is a file called php.ini for us to change the settings... but i cannot find it anywhere...Please Help