upload:
<?php require_once('../../Connections/cms.php');
mysql_select_db($database_cms, $cms);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Upload billede</title>
<link href="../css/styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {font-size: 12}
-->
</style>
</head>
<body>
<br>
<?php
if (isset($_FILES['filnavn'])) {
print "Fil, der er blevet overført : {$_FILES['filnavn']['name']}<p>\n";
$query = "INSERT INTO billeder SET billednavn='".$_FILES['filnavn']['name']."'";
$Result1 = mysql_query($query, $cms) or die(mysql_error());
}
{
$tempfile = $_FILES['filnavn']['tmp_name'];
$destination = "../billeder/{$_FILES['filnavn']['name']} ";
move_uploaded_file( $tempfile, $destination );
}
?>
<form action="upload.php" method="post" enctype="multipart/form-data" name="form1">
<p><span class="style2">Fil der skal overføres</span>
<input name="filnavn" type="file" id="filnavn">
</p>
<p>
<input type="submit" name="Submit" value="Overfør billede">
</p>
</form>
</body>
</html>