mercredi 30 décembre 2015

How can I set a session var using javascript and get it via php code

I have a javascript code like this :

<script type="text/javascript">

    $('#editRole').on('show.bs.modal', function (e) {  

        $roleID =  $(e.relatedTarget).attr('data-id');
        // Here I want to set this $roleID in session may be like this :
        Session['roleID'] = $roleID;                      
    });    

</script>

Then I want to get that $roleID in an other place using php code, may be like this :

<?php $roleID = Session::get('roleID'); //do something ....  ?>

Thanks



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1NS45yX
via IFTTT

Aucun commentaire:

Enregistrer un commentaire