Jump to content

Print Photo Thumbnails Script **Should an easy fix**


iisthesloth

Recommended Posts

Hey guys, this is stumpin me. I'm getting an unexpected T_STRING error. I know it has to do  with the quotation marks, well atleast i'm pretty sure it does...

 

for ($row=0; $row < $num_rows; $row++){
    print("<div id="imageWrap">\n");

  for ($col=0; $col < $photos_per_row; $col++){
      if($i < $total_photos){
        $thumbnail = $thumbnail_dir.trim($photos[$i]);
        $thumb_image_size = getimagesize($thumbnail);
        $image_size = getimagesize(trim($photos[$i]));
        print("<div class="image"><a href=\"javascript:photo_open('photo_display.php?photo=".trim($photos[$i])."','".$image_size[0]."','".$image_size[1]."');\"><img src=\"".$thumbnail."\" ".$thumb_image_size[3]."></a></div>\n");
      } else {
        print("");
      }
      $i++;
    }
    print("</div>\n");
}
?> 

  • 3 weeks later...

I don't know much about php, but you need to escape the " characters. So...

 

print("<div id="imageWrap">\n");

 

becomes

 

print("<div id=\"imageWrap\">\n");

 

Same thing needs to be done for any " appearing within:

 

print(" ");

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.