0

Hi,
I need help with this... can anyone help me?? Plssssss
Im getting Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING in line 10

What's wrong with it... can't seemed to find the error. Im trying to make my blog display the video.

<?php
$file = $_GET['file'];
$image = $_GET['image'];
?>
<script type='text/javascript' src='http://domain.com/jwplayer.js'></script>
<div id='mediaspace'>domain.com</div>

<script type='text/javascript'>
jwplayer('mediaspace').setup({
'flashplayer': 'http://domain.com/player.swf',
'file': '<?php echo $file;?>',
'image': '<?php echo $image;?>',
'title': 'title',
'controlbar': 'bottom',
'width': '470',
'height': '320'
});
</script>
2
Contributors
2
Replies
8
Views
4 Years
Discussion Span
Last Post by darl.liew
2

Have you tested what are the values are in the $_GET? Are they comming from a form or you construct a URL + query string some other way? You should always check for posted values:

if(isset($_GET['file']) && isset($_GET['image'])) {
    $file = $_GET['file'];
    $image = $_GET['image'];
} else {
    // handle error as apprpriate for your app
    // i.e die...
    die('Error: File or image missing!');
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.