image resize - "open_basedir restriction in effect&
Posted: Wed May 25, 2005 4:20 am
hello. i am trying to modify a news script that allows uploading images to automatically resize the images. here's the code i have:
the images:
the image call:
the modification for auto resize:
i keep getting the following error message and am kind of stuck as to why:
Warning: getimagesize(): open_basedir restriction in effect. File(/****/******/photo/1115200293CAM_CommAppMedia.jpg) is not within the allowed path(s): (/home/httpd/vhosts/********/httpdocs:/tmp) in /home/httpd/vhosts/*********/httpdocs/*****/*******/news.php on line 43
any pointers would be very helpful. thanks alot!
the images:
Code: Select all
$picture = $result[0]["picture"];
$picturepath = "/***/*******/photo/";Code: Select all
if (!empty($picture)){
print "<div><img src=\"$picturepath$picture\" alt=\"$title\"></div>";Code: Select all
if (!empty($picture)){
function imageResize($picture, $target, $alt=NULL) {
$theimage = getimagesize($picture);
$width = $theimage[0];
$height = $theimage[1];
if ($width > $height) {
$percentage = ($target / $width);
} else {
$percentage = ($target / $height);
}
$width = round($width * $percentage);
$height = round($height * $percentage);
echo "<img src=\"$picturepath$picture\" width=\"$width\" height=\"$height\" alt=\"$alt\">";
}
imageResize("$picturepath$picture", 50, "alt");Warning: getimagesize(): open_basedir restriction in effect. File(/****/******/photo/1115200293CAM_CommAppMedia.jpg) is not within the allowed path(s): (/home/httpd/vhosts/********/httpdocs:/tmp) in /home/httpd/vhosts/*********/httpdocs/*****/*******/news.php on line 43
any pointers would be very helpful. thanks alot!