Jump to content

Syntax error unexpected '' expecting & or T_Variable


acctman

Recommended Posts

how do i fix this error

Syntax error unexpected '' expecting & or T_Variable


function drop_player ( video, drop_location ) {
player_html = '<embed style="margin: 5px;" id="flash_player" src="/flvplayer.swf" width="<?php=$video_width;?>" height="<?php=$video_height;?>" allowfullscreen="true" flashvars="&file='+video+'&height=<?php=$video_height;?>&width=<?php=$video_width;?>&location=/flvplayer.swf"" /></embed>';
$(drop_location).innerHTML = player_html;
}

<?php='something'?>

isn't correct.

 

You need to do

<?php echo 'something' ?>

 

='+video+'&

 

First, PHP uses ' . $video . ' not ' + $video + ' second, php uses $ before the variable names. Are you coding Javascript or PHP?

 

It's Javascript, but for some reason he decided to put it in

 tags. You can see the opening and closing PHP tags in the code.

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.