PHP fatal error

HosteyMega
edited November -1 in Support Forums

My website: https://my.hosteyme.ga/login.php

View error by login: Username: hmp_19060100 , Password: ABc123

Error:

Fatal error: Uncaught Error: Call to undefined function session_register() in /home/vol3_2/unaux.com/unaux_23970071/my.hosteyme.ga/htdocs/login.php:21 Stack trace: #0 {main} thrown in /home/vol3_2/unaux.com/unaux_23970071/my.hosteyme.ga/htdocs/login.php on line 21

login.php:

     `<?php
       include("config.php");
       session_start();

       if($_SERVER["REQUEST_METHOD"] == "POST") {
          // username and password sent from form 

          $myusername = mysqli_real_escape_string($db,$_POST['username']);
          $mypassword = mysqli_real_escape_string($db,$_POST['password']); 

          $sql = "SELECT * FROM hmp_account WHERE username = '$myusername' and password = '$mypassword'";
          $result = mysqli_query($db,$sql);
          $row = mysqli_fetch_array($result,MYSQLI_ASSOC);
          $active = $row['active'];

          $count = mysqli_num_rows($result);

          // If result matched $myusername and $mypassword, table row must be 1 row

          if($count == 1) {
             session_register("myusername");
             $_SESSION['login_user'] = $myusername;

             header("location: welcome.php");
          }else {
             $error = "Your Login Name or Password is invalid";
          }
       }
    ?>
    <html>

       <head>
          <title>HMP Login</title>
          <link rel="shortcut icon" href="image/favicon.ico" type="image/x-icon">

          <style type = "text/css">
             body {
                font-family:Arial, Helvetica, sans-serif;
                font-size:14px;
             }
             label {
                font-weight:bold;
                width:100px;
                font-size:14px;
             }
             .box {
                border:#666666 solid 1px;
             }
          </style>

    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script>
      (adsbygoogle = window.adsbygoogle || []).push({
        google_ad_client: "ca-pub-7074728236863065",
        enable_page_level_ads: true
      });
    </script>
       </head>

       <body bgcolor = "#66e0ff">

          <div align = "center">
             <div style = "width:300px; border: solid 1px #333333; " align = "center">
                <div style = "background-color:#333333; color:#FFFFFF; padding:3px;"><img src="image/hmp.jpg" alt="HMP Logo">
        <b><h1>HMP Login</h1></b></div>

                <div style = "margin:30px">

                   <form action = "" method = "post">
                      <label>Username  :</label><input type = "text" name = "username" class = "box"/><br /><br />
                      <label>Password  :</label><input type = "password" name = "password" class = "box" /><br/><br />
                      <input type = "submit" value = " Login "/><br />
                   </form>

                   <a href="https://help.hosteyme.ga">Lost Password</a>

                   <div style = "font-size:11px; color:#cc0000; margin-top:10px"><?php echo $error; ?></div>

                </div>

             </div>

          </div>

    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script>
      (adsbygoogle = window.adsbygoogle || []).push({
        google_ad_client: "ca-pub-7074728236863065",
        enable_page_level_ads: true
      });
    </script>
       </body>
    </html>`

Please help! Thanks!