PHP Login System with Admin Features

This forum was created to talk about the PHP Login System with admin features created by jpmaster77 on evolt's website


    change password help

    Share
    avatar
    intothefantasy

    Number of posts : 37
    Registration date : 2009-04-11

    change password help

    Post  intothefantasy on Mon May 18, 2009 1:40 pm

    ok i wanna create my own change password page for my user...but i wanna use all the error check form from session...

    which i do like this

    Code:
    if(!$oldpw){
                echo "<font size=\"2\" color=\"#ff0000\">* Current Password not entered</font>";
          }
          else {
          if(strlen($oldpw) < 4 ||
                  !eregi("^([0-9a-z])+$", ($oldpw = trim($oldpw)))){
                  echo "<font size=\"2\" color=\"#ff0000\">* Current Password incorrect</font>";
                }
    if($database->confirmUserPass($this->username,md5($oldpw)) != 0){
                  echo "<font size=\"2\" color=\"#ff0000\">* Current Password incorrect";
                }
                }
            if(strlen($newpw) < 4){
                echo "<br><font size=\"2\" color=\"#ff0000\">* New Password too short</font>";
            }
            /* Check if password is not alphanumeric */
            else if(!eregi("^([0-9a-z])+$", ($newpw = trim($newpw)))){
                echo "<br><font size=\"2\" color=\"#ff0000\">* New Password not alphanumeric</font>";
            }
            if (!$newpw){
              echo "<br><font size=\"2\" color=\"#ff0000\">* New Password not entered</font>";
              }

    but currently .. i am having this part of problem

    Code:
    if($database->confirmUserPass($this->username,md5($oldpw)) != 0){
                  echo "<font size=\"2\" color=\"#ff0000\">* Current Password incorrect";
                }

    it give me problem of using this part to check current password is incorrect cuz of $this->username problem...wat should i need to replace this part?
    avatar
    Linchpin311

    Number of posts : 220
    Age : 32
    Localisation : Long Island
    Registration date : 2007-05-14

    Re: change password help

    Post  Linchpin311 on Wed May 20, 2009 5:39 pm

    is your function set up to accept $this->username? depending on where this code is you may be able to use $session->username. try that, if that doesnt work try global $session in your function and then try using $session->username.

    if none of these things work i think we'll need more information about your function.


    _________________
    in the end, the universe tends to unfold as it should...

    Also note that it is your responsibility to die() if necessary.

      Current date/time is Mon Dec 11, 2017 7:00 pm