Mal1 Posted April 12, 2013 Share Posted April 12, 2013 I'm getting a syntax error on line 109 with this code on Dreamweaver (not my code), the code seems to work but would like to fix the syntax if possible. <?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; ?> Link to comment https://forums.phpfreaks.com/topic/276868-what-is-wrong-with-this-syntax-code-snippet/ Share on other sites More sharing options...
Barand Posted April 12, 2013 Share Posted April 12, 2013 if "preloaded" is a variable you need $ prefix Link to comment https://forums.phpfreaks.com/topic/276868-what-is-wrong-with-this-syntax-code-snippet/#findComment-1424365 Share on other sites More sharing options...
Jessica Posted April 12, 2013 Share Posted April 12, 2013 He's trying to generate js. There's absolutely no reason to keep starting and stopping PHP tho. Link to comment https://forums.phpfreaks.com/topic/276868-what-is-wrong-with-this-syntax-code-snippet/#findComment-1424378 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.