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; ?> Quote 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 Quote 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 (edited) He's trying to generate js. There's absolutely no reason to keep starting and stopping PHP tho. Edited April 12, 2013 by Jessica Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.