1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

php thumbnail resize html tag best practice

Discussion in 'PHP' started by Vijizzle, Jul 9, 2006.

  1. #1
    Hey guys quick question

    Im creating an online photo gallery as part of the script I take a folder full of photos then loop through the folder determining the path to each photo (photoURL) and printing out a line of code to display the photo- similiar to that below:
    <td><img src="photos.php?'photoUrl" onclick=window.open("photoUrl');></td>;

    My question is would it be better for me to incorporate the resizing script in the script that prints the img html - so I would do something like this ($im is the resized image.);

    <td><img src="$im" onclick=window.open("photoUrl');></td>;

    A large portion of my users will be on 56k so would using $im make the photos load faster?

    Does using "photos.php?'photoUrl" mean that for every photo the browser is doing a http request to photos.php which is then displaying the photo - that seems very inefficient to me.

    I hope that makes sense :)

    Thanks for your help.
    Vijizzle, Jul 9, 2006 IP