i have images that are 90% A4 size and some that are post card size. when i click on the thumbnails i create i display the full sized image but A4 is massive to display so i need to shrink it down to fit on the screen.

i create the thumbnails from the original image in the first place so i thought i could use the same code to just shrink the oringal image to a size thats suitable. (the code just grabs the image from the folder and just shrinks it down)

to display the thumbnail is use this code :

PHP Code:
while ($row $result->fetch_assoc()) {
"<a href=\"image.php?id=" $row['id'] . "\">";
"<img src=\"imageResize.php?imageFilename=" $row['name'] . "&maxHeight=120,&maxWidth=150\" />\n";

but when i click on the thumbnail to display the full sized image i used this:

PHP Code:
while($row $result->fetch_row()) {
"<img src=\"" $row[2] . "\" />";

i need to somehow in the src use imageResize but ive tried a fair amount of ways but have not figured it out yet. could someone please advise