0

チェックログインとログインとして次のスクリプトを使用します。

<?php
        
   include('../db_connections/aardb_conn.php'); 
   session_start(); 
   
         #***********************************
         # get info from form.
         #***********************************
        
            $myusername=$_POST['email']; 
            $mypassword=$_POST['pass']; 
            
             
                 $sql="SELECT * FROM users WHERE email='$myusername' and password='$mypassword'";
               
      $result=mysql_query($sql, $db_conn);
      $count=mysql_num_rows($result);

       if ($count==1)
       {
         session_register("my_username");
         session_register("userid");
         $row = mysql_fetch_assoc($result) ;
         $_SESSION['my_username']= $row[fname]." ".$row[lname] ;
         $_SESSION['userid']=$row[autoid] ;
         
          mysql_free_result($result);
              
              header("location:../account.php");
             }#end of if
        else 
           {  
              header("location:../attempt.php");
        }#end of else
?>

しかし、次のエラーが表示されます。

非推奨: 関数 session_register() は、/home/content/80/11429180/html/admin/logs/checklogin.php 行 35 で非推奨です

非推奨: 関数 session_register() は、36 行目の /home/content/80/11429180/html/admin/logs/checklogin.php で非推奨です

警告: ヘッダー情報を変更できません - /home/content/80/11429180/html/admin/ の (/home/content/80/11429180/html/admin/logs/checklogin.php:35 で開始された出力) によって既に送信されたヘッダー43行目のlogs/checklogin.php

4

4 に答える 4