contra10 Posted September 9, 2009 Share Posted September 9, 2009 hi I'm trying to put a javascript in my php tags but it doesn't seem to echo anything out <?php $querye = "SELECT * FROM `musiclinks`"; $resulte = mysql_query($querye) or die(mysql_error()); while ($postede = mysql_fetch_assoc($resulte)) { $filename = "{$postede['filename']}"; $date = "{$postede['date']}"; $link = "{$postede['link']}"; $type = "{$postede['type']}"; echo"<p id='audioplayer_1'>$date</p>"; echo"<script type='text/javascript'>"; echo"AudioPlayer.embed('audioplayer_1', {soundFile: 'http://www.website.com/songs/$filename'});"; echo"</script>"; echo"<tr><td width='%50'><a href=''></a></td><td width='%50'></td></tr>"; } ?> I also tried to change it to this thinking it was the quotations: <?php $querye = "SELECT * FROM `musiclinks`"; $resulte = mysql_query($querye) or die(mysql_error()); while ($postede = mysql_fetch_assoc($resulte)) { $filename = "{$postede['filename']}"; $date = "{$postede['date']}"; $link = "{$postede['link']}"; $type = "{$postede['type']}"; echo"<p id='audioplayer_1'>$type</p>"; echo"<script type=\"text/javascript\">\n"; echo"AudioPlayer.embed(\"audioplayer_1\", {soundFile: \"http://www.website.com/songs/$filename\"});\n"; echo"</script>"; echo"<tr><td width='%50'><a href=''></a></td><td width='%50'></td></tr>"; } ?> Quote Link to comment Share on other sites More sharing options...
contra10 Posted September 9, 2009 Author Share Posted September 9, 2009 should i be in the php forum or java? Quote Link to comment Share on other sites More sharing options...
trq Posted September 9, 2009 Share Posted September 9, 2009 Your using Javascript not Java. There is a massive difference. I don't see any issues with the code provided, what does the html output look like? Quote Link to comment Share on other sites More sharing options...
contra10 Posted September 10, 2009 Author Share Posted September 10, 2009 sorry about that, I don't get any output though Quote Link to comment Share on other sites More sharing options...
chmpdog Posted September 10, 2009 Share Posted September 10, 2009 That should echo check to make sure it is in the source Quote Link to comment 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.