Im having trouble storing sessiondate on user login for my shopping cart, it works fine the first time but if I logout and log back in again it says this
Notice: Undefined index: username in c:\inetpub\wwwroot\mymarket\login.php on line 23
and repeats it a few times for the other variables, here's the code anyway:
{
$user = verify_login($HTTP_POST_VARS["username"], $HTTP_POST_VARS["password"]);
if ($user) {
$SESSION["user"] = $user;
$SESSION["ip"] = $REMOTE_ADDR;
/* if wantsurl is set, that means we came from a page that required log in, so let's go back there. otherwise go back to the main page */
$goto = empty($SESSION["wantsurl"]) ? $CFG->wwwroot : $SESSION["wantsurl"];
header("Location: $goto");
die;
} else {
$errormsg = "Invalid login, please try again";
$frm["username"] = $HTTP_POST_VARS["username"];
}
}
include("$CFG->templatedir/login_form.php")
(this form just collects username and password)
the script previously had
if (match_referer() && isset($HTTP_POST_VARS))
but this just made the form reset without submitting.
anyone got any ideas??
Thanks!
Carlp
๐