Jump to content

Error


JustFriend

Recommended Posts

I want to make a Facebook Like Box and some After setting it on your index.php or game.php threw me an error that looks like this:

 

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/manoww/domains/manowwe.us.lt/public_html/index.php on line 282

 

FaceBook Like Box: <iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fmanowwe&width=300&height=590&colorscheme=light&show_faces=true&header=true&stream=true&show_border=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:590px;" allowTransparency="true"></iframe>

 

<b>Could you explain where the error?<b>

Link to comment
https://forums.phpfreaks.com/topic/281521-error/
Share on other sites

  • 3 weeks later...

Syntax highlighting already shows you what's wrong. You need to use double quotes inside the string or escape the single quotes with a backslash.

When echoing code it's a good idea to use the heredoc quote syntax; you do not have to escape any quotes inside such a string:

echo <<<EOF
<script type="text/javascript">
window.addEvent('domready', function() {
SqueezeBox.fromElement('modalLink1');
});
</script>
EOF;

Another solution would be simply ending the PHP mode:

?>
<script type="text/javascript">
window.addEvent('domready', function() {
SqueezeBox.fromElement('modalLink1');
});
</script>
<?php

Link to comment
https://forums.phpfreaks.com/topic/281521-error/#findComment-1449212
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.