<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Upload billede</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
if(isset($_FILES['filnavn'])){
print "Fil, der blevoverført: {$_FILES['filnavn']['name']}<p>\\n";
$query = "INSET INTO billeder SET billednavn='".$_FILES['filnavn']['name']."'";
$result1 = mysql_query($query, $database) or die(mysql_erro());
}
if(isset($_POST(besked)){
$query2 = "INSET INTO billeder SET besked='".$besked."'";
$result2 = mysql_query($query2, $database) or die(mysql_erro());
}
if(isset($_FILES['filnavn'])){
$tempfile = $_FILES['filnavn']['tmp_name'];
$destination = '../billeder/{$_FILES['filnavn']['name']} ';
copy($tempfile, $destination);
}
?>
<form action="upload.php" method="POST" enctype="multipart/form-data" name="upload" id="upload">
<p>Fil, der skal overføres:
<input name="filnavn" type="file" id="filnavn">
<p>Besked:</p> <input type="text" name="besked">
</p>
<p>
<input type="submit" name="Submit" value="Overfør">
</p>
</form>
</body>
</html>
Burde ca virke... husk at lave en connetion og sætte en variabel $database med din database