www.webdeveloper.com
Results 1 to 2 of 2

Thread: mia/autodemote/autodisable system

  1. #1
    Join Date
    May 2006
    Posts
    412

    mia/autodemote/autodisable system

    i have a login system where the user logs in but now what i want it to do is 3 things i want to intergrate a mia (missing in action script so the user doesnt have to login) and the other 2 things are if they havnt logged in for 3 days demote them and if they still havnt logged in then disable them automatically this is what my login system has already.

    PHP Code:
    <?php
        session_start
    ();
        
    $msg_pass="";
        
    $msg_user="";
        
    error_reporting(E_ALL);
        
    $username=$_POST['username'];
        
    $password=$_POST['password'];
        if(
    $username && $password)
        {
            
    //include database        
            
    include("dbconnect.inc");
            
    $cQuery="SELECT * FROM members WHERE username='".$username."'";
            
    //echo $cQuery;
            
    $rs=mysqli_query($con,$cQuery);
            if(!
    $rs)
            {
                echo 
    "Unable to excute the query:".mysqli_connect_errno($con);
            }
            else
            {
                    
    $count=mysqli_num_rows($rs);
                    if(
    $count>0)
                    {
                        
    $data=mysqli_fetch_assoc($rs);
                        if(
    $data['password']=$password)
                        {
                            if(
    $data['disable']==1)
                            {
                                echo 
    "You have been disabled<br>\n";
                            } 
                            else if(
    $data['disable']==0)
                            {
                                echo 
    "Logged in successfully<br>\n";
                                if(
    $data['rank']==0)
                                {
                                    echo 
    "Hello Your rank is 0<br>\n";
                                    include(
    "membersnav.inc");
                                }
                                if(
    $data['rank']==1)
                                {
                                    echo 
    "Hello Your rank is 1<br>\n";
                                    
    //include("membersnav.inc");
                                
    }
                                if(
    $data['rank']==2)
                                {
                                    echo 
    "Hello,Your Rank is Ensign<br>\n";
                                    
    //include("membersnav.inc");
                                
    }
                                if(
    $data['rank']==3)
                                {
                                    echo 
    "Hello,Your Rank is 1st General<br>\n";
                                    
    //include("membersnav.inc");
                                
    }
                                if(
    $data['rank']==4)
                                {
                                    echo 
    "Hello,Your Rank 1 star gen<br>\n";
                                    
    //include("membersnav.inc");
                                
    }
                            }
                        }
                            else
                            {
                                
    $msg_pass="Wrong Password,Please Try again<br>\n";
                            }
                        }
                        else
                        {
                            
    $msg_user="Wrong Username,Please Try again<br>\n";
                        }
                    }
                }
    How do i go about doing this?

  2. #2
    Join Date
    Oct 2005
    Location
    Gold Coast, Australia
    Posts
    2,115

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles