Parse error
Hej..Jeg får denne meddelse:
Parse error: parse error, unexpected T_FUNCTION in /customers/skyskraber.dk/skyskraber.dk/httpd.www/iceforum/users/imageresize.php on line 12
i dette script:
<?phpphp
/*************************************************************\
* Image resizer, version 1.3 alpha *
* Returns true on success, false if there are errors *
* If destination file is specified, resized picture will be *
* saved with the specified name. Else, it is shown to browser *
}*************************************************************{
* Created by XyborX (www.xyborx.dk) *
* Feel free to use, modify and distribute, without profit. *
* I cannot be held liable for any damage this script might do *
\*************************************************************/
function imageresizejpeg($sourcefile,$maxwidth,$maxheight,$destinationfile=false)
{
if($img_src=@ImageCreateFromJpeg($sourcefile))
{
$info=@getimagesize($sourcefile);
if($info[1]>$maxheight || $info[0]>$maxwidth)
{
$ratio_height=$maxheight/$info[1];
$ratio_width=$maxwidth/$info[0];
$ratio=min($ratio_width,$ratio_height);
$newwidth=intval($info[0]*$ratio);
$newheight=intval($info[1]*$ratio);
$img_dst=@imagecreate($newwidth,$newheight);
@imagecopyresized($img_dst, $img_src, 0, 0, 0, 0, $newwidth, $newheight, $info[0], $info[1]);
if($destinationfile==false)
{
header("Content-type: image/jpeg");
@imagejpeg($img_dst);
}
else
@imagejpeg($img_dst,$destinationfile);
@imagedestroy($img_dst);
}
else
{
if($destinationfile==false)
{
header("Content-type: image/jpeg");
@imagejpeg($img_src);
}
else
@imagejpeg($img_src,$destinationfile);
}
@imagedestroy($img_src);
return true;
}
else
{
return false;
}
}
?>
Hvad er der galt i det, mener ellers det har virket før.