I have been looking at SO posts for hours trying to figure this out. I would like to be able to change my src in a js script using a dynamically created session variable.
$source = $_SESSION['amz'];echo $source;
echo's mws like it is supposed to. Now I am trying to get it into my script:
$a = ?><script type="text/javascript" src="buyback'<?php echo $source; ?>'.js"></script>
I keep getting the following error:
PHP Parse error: syntax error, unexpected ';' in /chroot/home/bookcell/bookcellaronline.com/html/testbcos/buyback/buybackmws.php on line 12
Line 12 is the $a line. Is this the correct start at least? Am I just missing something very basic?? I do have session_start() at the beginning of the page.
EDIT: I pass $a into the header of the html page:
<script type="text/javascript" src="../js/jquery_idleTimeout.js"></script>
<?php echo $a; ?>