essjay_d12 Posted May 18, 2007 Share Posted May 18, 2007 It is possible to put some javascript into a $_SESSION variable? I want to put javascript:history:back() into a session, is this possible and if so does it still function in correct way? cheers d Link to comment https://forums.phpfreaks.com/topic/52007-javascript-into-a-session/ Share on other sites More sharing options...
mainewoods Posted May 18, 2007 Share Posted May 18, 2007 javascript can be put in a session variable, but only as text, and it can only be accessed and printed out server side, and then will execute browser side: server side code: <script type="text/javascript"> <?php echo $_SESSION['myjs']; ?> </script> if the session variable 'myjs' contained: alert('hello'); it would echo into the page server side and then execute browser side Link to comment https://forums.phpfreaks.com/topic/52007-javascript-into-a-session/#findComment-256550 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.