upload fejl?
Jeg får denne fejl:Warning: open_basedir restriction in effect. File is in wrong directory in /mnt/dkcphnas003/www/1/7/197.dk/scooter-ratings/scoots/size.php on line 4
med dette script:
<?
function fullsize($newpic) {
$maxwidth = "400";
$imagehw = GetImageSize($newpic);
$imagewidth = $imagehw[0];
$imageheight = $imagehw[1];
$type = $imagehw[2];
$imgorig = $imagewidth;
if ($imagewidth > $maxwidth) {
$imageprop=($maxwidth*100)/$imagewidth;
$imagevsize= ($imageheight*$imageprop)/100 ;
$imagewidth=$maxwidth;
$imageheight=ceil($imagevsize);
}
$fswidth = $imagewidth;
$fsheight = $imageheight;
return $fswidth;
return $fsheight;
}
function thumbsize($newpic) {
$maxwidth = "100";
$imagehw = GetImageSize($newpic);
$imagewidth = $imagehw[0];
$imageheight = $imagehw[1];
$imgorig = $imagewidth;
if ($imagewidth > $maxwidth) {
$imageprop=($maxwidth*100)/$imagewidth;
$imagevsize= ($imageheight*$imageprop)/100 ;
$imagewidth=$maxwidth;
$imageheight=ceil($imagevsize);
}
$tnwidth = $imagewidth;
$tnheight = $imageheight;
return $tnwidth;
return $tnheight;
}
function sigsize($newpic) {
$maxheight = "120";
$imagehw = GetImageSize($newpic);
$imagewidth = $imagehw[0];
$imageheight = $imagehw[1];
$imgorig = $imagewidth;
if ($imageheight > $maxheight) {
$imageprop=($maxheight*100)/$imageheight;
$imagevsize= ($imagewidth*$imageprop)/100 ;
$imageheight=$maxheight;
$imagewidth=ceil($imagevsize);
}
$snwidth = $imagewidth;
$snheight = $imageheight;
return $snwidth;
return $snheight;
}
if ($upload == "ok") {
fullsize($image);
thumbsize($image);
$sigsize($image);
$size = GetImageSize($image);
$width = $size[0];
$height = $size[1];
$type = $size[2];
if ($type == 1) {
$src = imagecreatefromgif("$image");
$im = imagecreate($fswidth,$fsheight);
imagecopyresized($im,$src,0,0,0,0,$fswidth,$fsheight,$width,$height);
imagejpeg($im, "fullsize/hej.jpg");
imagedestroy($im);
} else if ($type == 2) {
$src = imagecreatefromjpeg("$image");
$im = imagecreate($newwidth,$newheight);
imagecopyresized($im,$src,0,0,0,0,$fswidth,$fsheight,$width,$height);
imagejpeg($im, "fullsize/hej.jpg");
imagedestroy($im);
} else if ($type == 3) {
$src = imagecreatefrompng("$image");
$im = imagecreate($newwidth,$newheight);
imagecopyresized($im,$src,0,0,0,0,$fswidth,$fsheight,$width,$height);
imagejpeg($im, "fullsize/hej.jpg");
imagedestroy($im);
} else {
echo "Formatet er ikke understøttet! Kun GIF, JPG og PNG!";
}
print "<img src=\"fullsize/hej.jpg\">";
}
if (!$upload) {
?>
<form method="post" enctype="multipart/form-data" action="size.php">
<input type="hidden" name="MAX_FILE_SIZE" value="400000">
<input type="hidden" name="upload" value="ok">
File 1: <input type="file" name="image" size="30"><br>
<input type="submit" value="Upload">
</form>
<?
}
?>
hvorfor?
safe mode er ikke on!
