acctman Posted May 30, 2009 Share Posted May 30, 2009 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; } Link to comment https://forums.phpfreaks.com/topic/160269-syntax-error-unexpected-expecting-or-t_variable/ Share on other sites More sharing options...
Garethp Posted May 30, 2009 Share Posted May 30, 2009 ='+video+'& First, PHP uses ' . $video . ' not ' + $video + ' second, php uses $ before the variable names. Are you coding Javascript or PHP? Link to comment https://forums.phpfreaks.com/topic/160269-syntax-error-unexpected-expecting-or-t_variable/#findComment-845779 Share on other sites More sharing options...
Daniel0 Posted May 30, 2009 Share Posted May 30, 2009 <?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. Link to comment https://forums.phpfreaks.com/topic/160269-syntax-error-unexpected-expecting-or-t_variable/#findComment-845781 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.