Joomla! Custom form logs the user out on submission
问题 I have the following php embedded into a Joomla! article, using the Sorcerer plugin; <?php $user = JFactory::getUser(); $username = $user->username; $user_id = $user->id; if (isset($_GET['action'])){ date_default_timezone_set('Europe/London'); $user= JFactory::getUser(); $username=$user->username; $user_id=$user->id; $date_now=date('m/d/Y H:i:s'); $db =& JFactory::getDBO(); $insert_sql= "INSERT INTO KOSRequest (user_id,created,IGN,LKL,KOSReason,Status) VALUES (".$user_id.",'".$date_now."','".