Jump to content

Trying to have PHP Database notify of expiry date!


Atlanticas

Recommended Posts

Basically my site only notifies members "Wrong Username or Password" but I would like to somehow add an option where it would instead say "Membership expired" or even better 'Membership expired on 00/00/0000" when they attempt to access the site. Here is the part of the coding that shows up, so not sure if this is enough.

[code]<?php
/*                                                                                                                                              *
*************************************************************************
*                                                                                                                      *
************************************************************************/
class auth
{
/****************************************************************
* function login(&$ld)                                          *
*****************************************************************
* @Description:                                                *
*                                                              *
*****************************************************************
* @Parameters:                                                  *
*              &$ld                                              *
*****************************************************************
* @return                                                      *
****************************************************************/
function login(&$ld)
        {
            $dbu= new mysql_db;
            $now=strtotime("now");
            $dbu->query("select member_id, password from member where username='".$ld['login']."' and active2='1' and active1='1' and exp_date > '".$now."'");
            if($dbu->move_next())
            {
                if($ld['password']==$dbu->f('password'))
                    {
                            session_start();
                            $_SESSION['uid']=1;
                            $_SESSION['u_id']=$dbu->f('member_id');
                            $ld['u_id']=$dbu->f('member_id');
                            $ld['pn']="redirect";
                           
                            return true;
                    }
            }
            //$ld['error'].=gettext("Invalid Login or Password provided! <br>");
            $ld['error'].=gettext("Wrong Username or Password <br>");
            return false;
          }
/****************************************************************
* function logout(&$ld)                                                *
*****************************************************************
* @Description:                                                *
*                                                              *
*****************************************************************
* @Parameters:                                                  *
*              &$ld)                                              *
*****************************************************************
* @return                                                      *
****************************************************************/

function logout(&$ld)
        {

                $_SESSION['uid']=0;
                $_SESSION['u_id']=0;
                unset ($ld['fn']);
                $ld['pn']='login';
                session_destroy();
          return true;
        }
}//end class
?>
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.