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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.