i will provide you the example code. i am setting the session variable in php and i want to access that session variable in javascript.
Code: Select all
<?php
$_SESSION['admin']="lokesh";
?>
Moderator: General Moderators
Code: Select all
<?php
$_SESSION['admin']="lokesh";
?>
Code: Select all
<script>
var admin = '<?php echo $_SESSION['admin']; ?>';
</script>