Reputation: 11
please help me fix this script:
<?php $aaa = "<script>document.writeln(enc)</script>";
?>
var playerInstance = jwplayer("myElement");
playerInstance.setup({
width: '100%',
height: '360',
title: 'aaaaa',
description: 'dcascd',
file: window.atob('<?php echo $aaa; ?>'),
});
my ext javascript
var str= "http://example.com/video.mp4";
enc = window.btoa(str);
enc = String(enc);
player not display. please help me fix this code.
Upvotes: 1
Views: 154
Reputation: 4122
In your code, $aaa
equals a script tag, so you'd end up with:
file: window.atob('<script>document.writeln(enc)</script>'),
You must remember, PHP compiles first, then JS runs after it.
The order would be:
$aaa
would equal <script>document.writeln(enc)</script>
var playerInstance = jwplayer("myElement");
playerInstance.setup({
width: '100%',
height: '360',
title: 'aaaaa',
description: 'dcascd',
file: window.atob('<script>document.writeln(enc)</script>"; ?>'),
});
Upvotes: 1