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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.