0

I never uploaded a file before and I'm finding some problems regarding uploading a file in a directory which have some security. I searched on the internet and I found out that I need to make use of chmod php function however I have been fighting against my computer for two days now and I can't understand what is wrong with my coding. So here is my coding:

chmod("directory",0777);
if(isset($_POST['submit']))
{
	
	$target_path = "directory";
	$target_path = $target_path . basename($_FILES['uploadedfile']['name']); 
			
			
	if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) 
	{
				
				
		mysql_query("UPDATE account SET image = 'name' WHERE id = '$id'");
		echo"$name";
	} else{
		echo"NO";
	}
}

Thank you for your attention and time

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by tomato.pgn
0

So whats the problem ???is any error notified???or the uploading is not working....
Specify so that i could help you...

0

There is no error.

(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)

is always false

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.