PHP - Help With Session_is_registered
Hi, I'm trying to make an old php script (won't work on anything over 5.3) run on php7. I'm not a coder by any means but get along by adapting examples I find on the web. I'm doing OK for the most part but am stuck finding what to replace session_is_registered with. This is what it is currently: $pref = mysql_query("SELECT * FROM preferences WHERE ID = '0'",$connection) or die(mysql_error()); $pdata = mysql_fetch_array($pref); mysql_free_result($pref); // I've already changed the above to: // // pref = mysqli_query($connection,"SELECT * FROM preferences WHERE ID = '0'") // or die(mysqli_error($connection)); // $pdata = mysqli_fetch_array($pref); // mysqli_free_result($pref); // // Just wanted to show you the whole section in its orignal state. // It's this line below that I'm not sure about... if(!session_is_registered('defaultseasonid_') || !session_is_registered('defaultmatchtypeid_') || !session_is_registered('defaultlanguage_')) { $_SESSION['defaultseasonid_'] = $pdata['DefaultSeasonID']; $_SESSION['defaultmatchtypeid_'] = $pdata['DefaultMatchTypeID']; $_SESSION['defaultlanguage_'] = $pdata['DefaultLanguage']; $defaultseasonid = $_SESSION['defaultseasonid_']; $defaultmatchtypeid = $_SESSION['defaultmatchtypeid_']; $defaultlanguage = $_SESSION['defaultlanguage_']; } else { $defaultseasonid = $_SESSION['defaultseasonid_']; $defaultmatchtypeid = $_SESSION['defaultmatchtypeid_']; $defaultlanguage = $_SESSION['defaultlanguage_']; } session_unset(); Any pointers anybody can give me would be much appreciated. TIA Similar TutorialsGood day, I am looking for the replacement for session_is_registered. anyone has any idea? Code: [Select] <? session_start(); if(!session_is_registered(myusername)){ header("location:main_login.php"); } ?> <html> <body> Login Successful </body> </html> Thank you very much Hi, My host upgrade PHP yesterday and broke some code on my site. My developer is not avail... ERROR MSSG: Deprecated: Function session_is_registered() is deprecated in...followed by directory Here's the live of code that contains the error. if(!isset($_POST[$param_name]) && !isset($_GET[$param_name]) && session_is_registered($param_name)) Im assuming it has to do with "session_is_registered". Any ideas? thanks. Can anyone help me fix this problem: Deprecated: Function session_is_registered() is deprecated in/includes/functions/sessions.php on line 81 The code is: function tep_session_is_registered($variable) { return session_is_registered($variable); } function tep_session_unregister($variable) { return session_unregister($variable); } Fairly new to PHP and would greatly appreciate any help! |