Salve e scusate la banalità della domanda.

io ho questo codice:


<?php



$my_max_file_size = "3000000"; # in bytes
$image_max_width = "3000";
$image_max_height = "3000";


$registered_types = array(
"application/x-gzip-compressed" => ".tar.gz, .tgz",
"application/x-zip-compressed" => ".zip",
"application/x-tar" => ".tar",
"text/plain" => ".html, .php, .txt, .inc",
"image/bmp" => ".bmp, .ico",
"image/gif" => ".gif",
"image/pjpeg" => ".jpg, .jpeg",
"image/jpeg" => ".jpg, .jpeg",
"application/x-shockwave-flash" => ".swf",
"application/msword" => ".doc",
"application/vnd.ms-excel" => ".xls",
"application/octet-stream" => ".exe, .fla"
); # these are only a few examples, you can find many more!

$allowed_types = array("image/gif","image/pjpeg","image/jpeg","application/x-shockwave-flash");
//end global variables

function dbconnect() {
mysql_connect("******", "*****", "*******");
@mysql_select_db("******") or die ("Unable to select database");
}


function form($error=false) {

global $PHP_SELF, $my_max_file_size, $image_max_width, $image_max_height;
echo"<html><head><title>Uploading Files</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head>
<body bgcolor=\"#EAEAEA\">";
if ($error) print $error . "

";
echo "\n<form ENCTYPE=\"multipart/form-data\" action=\"" . $PHP_SELF . "\" method=\"post\">";
echo "\n</form>";
list_files();

echo"</body></html>";
} # END form

function list_files() {
$riga = $_REQUEST["id"];
var_dump($riga );
$result=mysql_query("select id, filename, filetype, filewidth, fileheight from mmkit_images");
if (mysql_num_rows($result) > 0) {
echo"<table width=\"98%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\" bordercolor=\"#000000\">";

echo"<tr bgcolor=\"#FFFFFF\"><td><img src=\"getdata.php?id=$riga\" width=\"$width\" height=\"$height\"></td>
</tr></table>";

}
else echo"
Il database &egrave vuoto.";
}//end list_files


dbconnect();

switch($task) {

default:
form($error);
}

?>



la pagina a cui passa l'id ha questo

<?php
function dbconnect() {
mysql_connect("****", "*****", "*****");
@mysql_select_db("*****") or die ("Unable to select database");
}
dbconnect();

if($id) {
$query = "select bin_data, filetype FROM mmkit_images WHERE id='$id'";

$result = @MYSQL_QUERY($query);

$data = @MYSQL_RESULT($result,0,"bin_data");
$type = @MYSQL_RESULT($result,0,"filetype");

Header("Content-type: $type");
echo $data;

};
?>

Praticamente tutto funziona alla perfezione se passo un'id alla prima pagina visualizzo correttamente la mia mmagine
adesso pero' vorrei ridimenzionarla


ho cercato in rete ed ho trovato questo

<?php

// Ottengo le informazioni sull'immagine originale
list($width, $height, $type, $attr) = getimagesize($_SERVER['DOCUMENT_ROOT'].'/foto/mydog.jpg');

// Creo la versione 120*90 dell'immagine (thumbnail)
$thumb = imagecreatetruecolor(120, 90);
$source = imagecreatefromjpeg($_SERVER['DOCUMENT_ROOT'].'/foto/mydog.jpg');
imagecopyresized($thumb, $source, 0, 0, 0, 0, 120, 90, $width, $height);

// Salvo l'immagine ridimensionata
imagejpeg($thumb, $_SERVER['DOCUMENT_ROOT']."/foto/mydog_thumb.jpg", 75);

?>


ma come posso fare per applicarlo al mio codice.

Please un aiutino