Jump to content

Script performance


Andy-H

Recommended Posts

I have this script to display images and this part of the code is running (extremely) slowly, can anyone point out why and possibly a way to improve the load time.

 


    for ($i = $_SESSION['x']; $n < 25; $i++){
      $file = "http://vle.tameside.ac.uk/user/pix.php/" . $i . "/f1.jpg";
      $type = @getimagesize($file);
      $type = $type['mime'];
      if ($type == "image/jpeg"){
      ++$n;
      echo '    <td align="center" width="100" height="125">
        <label for="' . $i . '"><img src="' . $file . '" width="100" height="100" alt="' . $i . '"></label><br><input type="checkbox" name="studId[]" value="' . $i . '" id="' . $i . '">
    </td>
';
          if ($n % 5 == 0){
            echo '  </tr>
  <tr>
';
          }
      }
    }

 

Thanks for any help.

Link to comment
https://forums.phpfreaks.com/topic/133532-script-performance/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.