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 Link to comment https://forums.phpfreaks.com/topic/93495-setting-session-onclick/ 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']; } ?> Link to comment https://forums.phpfreaks.com/topic/93495-setting-session-onclick/#findComment-479037 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.