Tried using that script but it's just not resizing the image at all. I've fixed all the other errors, including comment errors made on part by the author.
http://www.anime-cod...etimagesize.txt
http://www.anime-cod...etimagesize.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>GetImageSize Test</title>
</head>
<body>
<?php
function image_resize($width, $height, $target) {
//takes the larger size of the width and height and applies the
//formula accordingly...this is so this script will work dynamically with any size image
if ($width > $height) {
$percentage = ($target / $width);
} else {
$percentage = ($target / $height);
}
//gets the new value and applies the percentage, then rounds the value
$width = round($width * $percentage);
$height = round($height * $percentage);
//returns the new sizes in html image tag format...this is so you
//can plug this function inside an image tag and just get the
return "width=\"$width\" height=\"$height\"";
}
?>
<?php
//get the image size of the picture and load it into an array
$mysock = getimagesize("http://www.anime-coders.com/php/images/sock001.jpg");
?>
<!--using a standard html image tag, where you would have the
width and height, insert your new imageResize() function with
the correct attributes -->
<img src="images/sock001.jpg" <?php image_resize($mysock[0],
$mysock[1], 150); ?>>
</body>
</html>
I'm new to programming concepts and struggling to get stronger in it but it's a fight I will win. I'm just not sure at all what is going on right now. I already checked with the host support team and they said the function was enabled before anyone asks.
