I need use javascript to get the value of $PHPSESSID. I have done following:
<script language="javascript">
alert('<?= $PHPSESSID ?>');
</script>
but it don't work.
Please help me fix this bug!
how to use javascript get value $PHPSESSID?
you will have to use PHP to echo the javascript with the session_id(); function.
So:
session_start();
$my_var = session_id();
echo "<script language="javascript">
alert('$my_var');
</script>":
actually i revised that code...here something that actually works!!
<?php
session_start();
?>
<script language="javascript">
alert('<?=session_id();?>');
</script>