Forum Moderators: coopster

Message Too Old, No Replies

Syntax Error

I have a line of code that Dreamweaver is reporting as a syntax error.

         

malone19

11:45 am on Oct 16, 2009 (gmt 0)

10+ Year Member



Dreamweaver is reporting a syntax error in the following piece of code (2nd line although I don't know if that line is corrected if it'll move to the next):


<?php foreach ($gallery->images as $image_id): ?>
preloaded<?php echo $image_id; ?> = new Image();
preloaded<?php echo $image_id; ?>.src = "img/<?php echo $rug->data['id']; ?>_<?php echo $image_id; ?>_medium.jpg";
<?php endforeach; ?>

The code was already in place when I took over the website. Anyone know what's up with it?

mvaz

12:36 pm on Oct 16, 2009 (gmt 0)

10+ Year Member



You have not close the php tag on the secon line.

<?php foreach ($gallery->images as $image_id): ?>
preloaded<?php echo $image_id; ?> = new Image(); ?> is missing.

malone19

12:56 pm on Oct 16, 2009 (gmt 0)

10+ Year Member



mvaz,

Thanks, I had noticed that but didn't change it just in case.

I've now added in the ?> but the syntax error is still there...