newbie login problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Reggie

    newbie login problem

    Im having problems login in,this is my script. i was able to login
    before with number of user accounts i created, but for some reason now
    im unable to login, please have i look at the script to see if there
    anything wrong.am pretty stuck

    thanks

    <?
    $from_url = $_POST["fromurl"];
    $err = 0;
    $memberid=64;
    if ((isset($_POST["username"])) && (isset($_POST["passwd"]))) {
    $memberid = $f->checkLoginPass word($_POST["username"],
    $_POST["passwd"]);
    echo($_POST["username"]);

    $memberid=64;
    if ($memberid 0) {
    $_SESSION["memberid"] = $memberid;
    if ($from_url == "") {
    $from_url = "myhome";
    }
    header("Locatio n: myhome");
    exit;
    } else {
    $err = 1;
    }
    } else {
    $err = 1;
    }
    if ($err == 1) {
    $smarty = new Smarty();
    $smarty->assign("baseur l", $config["baseurl"]);
    if (isset($_POST["fromurl"])) {
    $smarty->assign("fromur l", $_POST["fromurl"]);
    }
    $smarty->assign("wrong" , 1);
    $smarty->assign("member id", $memberid);
    $smarty->assign("stats" , $stats);
    $smarty->display("login .htm");
    }

    ?>
  • Jerry Stuckle

    #2
    Re: newbie login problem

    Reggie wrote:
    Im having problems login in,this is my script. i was able to login
    before with number of user accounts i created, but for some reason now
    im unable to login, please have i look at the script to see if there
    anything wrong.am pretty stuck
    >
    thanks
    >
    <?
    $from_url = $_POST["fromurl"];
    $err = 0;
    $memberid=64;
    if ((isset($_POST["username"])) && (isset($_POST["passwd"]))) {
    $memberid = $f->checkLoginPass word($_POST["username"],
    $_POST["passwd"]);
    echo($_POST["username"]);
    >
    $memberid=64;
    if ($memberid 0) {
    $_SESSION["memberid"] = $memberid;
    if ($from_url == "") {
    $from_url = "myhome";
    }
    header("Locatio n: myhome");
    exit;
    } else {
    $err = 1;
    }
    } else {
    $err = 1;
    }
    if ($err == 1) {
    $smarty = new Smarty();
    $smarty->assign("baseur l", $config["baseurl"]);
    if (isset($_POST["fromurl"])) {
    $smarty->assign("fromur l", $_POST["fromurl"]);
    }
    $smarty->assign("wrong" , 1);
    $smarty->assign("member id", $memberid);
    $smarty->assign("stats" , $stats);
    $smarty->display("login .htm");
    }
    >
    ?>
    >
    I don't see how this ever worked. You set $memberid to 64, then to some
    value returned from checkLoginPassw ord(), then immediately back to 64
    again. You also echo $_POST['username'], which, if isn't set, will
    cause an E_NOTICE. If you are displaying notices, this will stop the
    redirect from happening.

    I suggest you go back to the version which works and take it from there.
    Some of the changes you made here make no sense other than for debugging.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    Working...