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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.