Jump to content

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(" ");

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.