I am trying to create a basic upload form for images or files. I have nearly cracked it I just need to get the actual file to be copied to the folder and it wont upload. Here is my code so far.
------------------------------- upload1.php ---------------------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form method="post" action="upload2.php">
Upload picture: <input name="img1" type="file">
<input type="submit" name="upload" value="Upload file">
</form>
</body>
</html>
-------------------- upload2.php---------------------------
<?
// Upload file or image
$random_number = rand(1, 999999999);
$FILES['img1'] = $random_number . ".jpeg";
@copy($FILES['img1'], "/var/www/html/testimages/". $FILES['img1']. "") or $log .= "Couldn't copy image to server<br>";
?>
<html>
</head>
<body>
<img src="<? echo $FILES['img1']; ?>" width="260" height="150" border="0">
<p>file uploaded....</p>
</body>
</html>