PHP Fatal error: Call to undefined function session_register() - From error log this is for a login page.
$mode = $_GET['mode'];
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
$encrypted_mypassword=md5($mypassword);
$result = mysql_query("SELECT * FROM user WHERE username='" . $myusername . "' and password='" . $encrypted_mypassword . "'",$db);
if(!$result) { echo mysql_error(); }
else {
$count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row
if($count == 1) {
$row = mysql_fetch_assoc($result); // Register $myusername, $mypassword
session_register("myusername");
session_register("mypassword");
$_SESSION['user_id'] = $row['username'];
$_SESSION['user_type'] = $row['usertype'];
$_SESSION['logged_in'] = TRUE;
header("location:index.php?level=1");
} else {
if($mode == "new") {
header("location:../beta2/AdvisorLogin.php?error=wrong");
} else {
header("location:login.php?error=wrong");
}
}
}
I believe this is because of php version any advise on changing the code to work with newer versions ?