I've made changes to the script, such that it now looks like this:
<html>
<body>
<form method="post" action="img2.php" enctype="multipart/form-data">
Pic 1: <input type = "file" name="pic1" value="<?php $_FILES['pic1']['name']; ?>">
<input type="submit" name="submit" value="Upload">
</form>
</body>
</html>
<?php
require ("connect.php");
$pic1 = $_FILES['pic1'];
$path="cms/anna/";
$pathfiles="../files/articles";
$result = ("INSERT INTO ban VALUES(NULL,'$pic1_name')");
mysql_query($result) or die();
chmod($pathfiles, 777);
$upload = copy($_FILES['pic1']['name'], $pathfiles."/".$pic1_name);
echo "$pic1_name";
?>
but when I try to upload a file, I'm getting this error message:
Warning: chmod failed: No such file or directory in c:\apache\htdocs\cms\anna\img2.php on line 11
Warning: Unable to open 'mgr3_05.jpg' for reading: No such file or directory in c:\apache\htdocs\cms\anna\img2.php on line 13
mgr3_05.jpg