lookee Posted November 17, 2008 Share Posted November 17, 2008 I'm attempting to embed the following code into a .php file, but every time I do, I get a syntax error. <div id="leaderboard_bridge"></div><script src="http://xs.mochiads.com/static/pub/swf/leaderboard.js" type="text/javascript"></script><script type="text/javascript">Mochi.addLeaderboardIntegration({partnerID: "x34551194587393"});</script> The error I get is Parse error: syntax error, unexpected '<' in /home/jumpodin/public_html/components/com_puarcade/puarcade.php on line 170 Basically, I don't know how to integrate this bit of code into my pre-existing .php script. I can't remove the <. I tried putting a ; at the end, but that doesn't work either. Any help would be greatly apprecaited. Link to comment https://forums.phpfreaks.com/topic/133030-php-syntaxembedding-code-into-script/ Share on other sites More sharing options...
Mr_J Posted November 17, 2008 Share Posted November 17, 2008 Just give a link there to see the page please Link to comment https://forums.phpfreaks.com/topic/133030-php-syntaxembedding-code-into-script/#findComment-691870 Share on other sites More sharing options...
ratcateme Posted November 17, 2008 Share Posted November 17, 2008 you need to echo it like echo '<div id="leaderboard_bridge"></div><script src="http://xs.mochiads.com/static/pub/swf/leaderboard.js" type="text/javascript"></script><script type="text/javascript">Mochi.addLeaderboardIntegration({partnerID: "x34551194587393"});</script>'; Scott. Link to comment https://forums.phpfreaks.com/topic/133030-php-syntaxembedding-code-into-script/#findComment-691871 Share on other sites More sharing options...
lookee Posted November 17, 2008 Author Share Posted November 17, 2008 I can't link it or href it because it has to be embedded in the actual file. The echo didn't show up inbetween the code tags.... Link to comment https://forums.phpfreaks.com/topic/133030-php-syntaxembedding-code-into-script/#findComment-691880 Share on other sites More sharing options...
ratcateme Posted November 17, 2008 Share Posted November 17, 2008 replace it with echo '<div id="leaderboard_bridge"></div><script src="http://xs.mochiads.com/static/pub/swf/leaderboard.js" type="text/javascript"></script><script type="text/javascript">Mochi.addLeaderboardIntegration({partnerID: "x34551194587393"});</script>'; Scott. Link to comment https://forums.phpfreaks.com/topic/133030-php-syntaxembedding-code-into-script/#findComment-691883 Share on other sites More sharing options...
lookee Posted November 17, 2008 Author Share Posted November 17, 2008 And when I try to echo it... echo "<div id="leaderboard_bridge"></div><script src="http://xs.mochiads.com/static/pub/swf/leaderboard.js" type="text/javascript"></script><script type="text/javascript">Mochi.addLeaderboardIntegration({partnerID: "x4455839574839567674"});</script>"; ?> The closing php tag doesn't turn red again... something is missing, and I can't figure out what... something in the embed code seems to be throwing off the syntax Link to comment https://forums.phpfreaks.com/topic/133030-php-syntaxembedding-code-into-script/#findComment-691884 Share on other sites More sharing options...
lookee Posted November 17, 2008 Author Share Posted November 17, 2008 Thanks.... The crappy tutorial I read gave two quote marks... <?php echo "Hello World"; Link to comment https://forums.phpfreaks.com/topic/133030-php-syntaxembedding-code-into-script/#findComment-691886 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.