Fik nu udskrevet hvilken fejl der er.
Warning: copy() [function.copy]: SAFE MODE Restriction in effect. The script whose uid is 67673 is not allowed to access /web/www/frac/users owned by uid 550 in /web/www/frac/users/a/agl/webhorsens/admin/upload.php on line 16
Warning: copy(/web/www/frac/users/billeder/4_250.JPG) [function.copy]: failed to open stream: No such file or directory in /web/www/frac/users/a/agl/webhorsens/admin/upload.php on line 16
Her er koden, men sjovt nok virker den på One.com og Gigahost webhotel.
<?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>
<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 er blevet overført: {$_FILES['filnavn']['name']}<p>\n";
$tempfile = $_FILES['filnavn']['tmp_name'];
$destination = $_SERVER["DOCUMENT_ROOT"]."/billeder/".$_FILES['filnavn']['name'];
copy($tempfile, $destination);
$query = "INSERT INTO billeder SET billednavn='".$_FILES['filnavn']['name']."'";
$Result1 = mysql_query($query, $cms) or die(mysql_error());
}
?>
<form action="upload.php" method="post" enctype="multipart/form-data" name="" id="">
<p>Fil der skal overføres:
<input name="filnavn" type="file" id="filnavn">
</p>
<p>
<input name="overfør" type="submit" id="overfør" value="Overfør">
</p>
</form>
</body>
</html>