jonnyw6969 Posted February 28, 2008 Share Posted February 28, 2008 Hi Is it possible to set a session from a variable by clicking on a link? Regards Jon Quote Link to comment Share on other sites More sharing options...
trq Posted February 28, 2008 Share Posted February 28, 2008 Yes. <a href="?var=foo">click</a> <?php session_start(); if (isset($_GET['var'])) { $_SESSION['var'] = $_GET['var']; } if (isset($_SESSION['var'])) { echo '$_SESSION[\'var\'] = '. $_SESSION['var']; } ?> 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.