Uploade af picture
Jeg kunne godt uploade billeder med denne script fra en domæne på one.com, men på surftown.dk gider den ikke uploade billedet ... why???function createT_img($imgName, $sou, $mappen) {
//resize image to put it into db
$imagename = $imgName;
$source = $sou; //$_FILES['img1']['tmp_name'];
$target = $mappen."/".$imagename;
$map = $mappen;
move_uploaded_file($source, $target);
$imagepath = $imagename;
$save = $mappen ."/". $imagepath; //This is the new file you saving
$file = $mappen ."/". $imagepath; //This is the original file
list($width, $height) = getimagesize($file) ;
$modwidth = $width;
$diff = $width / $modwidth;
$modheight = $height / $diff;
$tn = imagecreatetruecolor($modwidth, $modheight) ;
$image = imagecreatefromjpeg($file) ;
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ;
imagejpeg($tn, $save, 100) ;
$save = $mappen ."/sml_" . $imagepath; //This is the new file you saving
$file = $mappen ."/". $imagepath; //This is the original file
list($width, $height) = getimagesize($file) ;
$modwidth = 260;
$diff = $width / $modwidth;
$modheight = $height / $diff;
$tn = imagecreatetruecolor($modwidth, $modheight) ;
$image = imagecreatefromjpeg($file) ;
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ;
imagejpeg($tn, $save, 100) ;
return $imagepath;
}
