A.A. PEACE A.A. PEACE - 5 months ago 56
PHP Question

assign a php variable to a sessionStorage var

I am trying to set a php variable value to a HTML5 sessionStorage. Is this feasible? Check my code below:

<script>sessionStorage.username = </script><php echo $_GET["user"]; ?>

Thank you in advance


Try this:

    sessionStorage.username = '<?php echo $_GET["user"]; ?>';

Code edited