/    Sign up×
Community /Pin to ProfileBookmark

if($_REQUEST[‘hid’] == “ok” && ($_REQUEST[‘Submit’] == ‘Submit’))
{
$user = $_POST[user];
$pass = $user[pass];
$email = $user[emailid];
$table = “gen_user”;
$where = “WHERE emailid = ‘$email’ AND password = ‘$pass’ AND status = ‘1’”;
$res = $Obj->GetAllWhere($table,$where);
if(count($res)>0)
{
if($_
REQUEST[‘cook’] == “remember”)
{
$u = $user[emailid];
//Setting cookie
$x = setcookie(“iw_user”, “$u”, time()+60*60*24*30);
}
$_SESSION[emailid] = $res[0][emailid];
$_
SESSION[first_name] = $res[0][first_name];
$_SESSION[type] = “user”;
header(“location:myaccount.php”);
}
else
{
$acc = “<font color=’red’>Invalid email id and password</font>”;
$smarty->assign(“arr”,$acc);
}
}

//check cookie is set or not
if (isset($_COOKIE[“iw_user”]))//checking user cookie check or not
{
$email = $_
COOKIE[“iw_user”];
$table = “gen_user”;
$where = “where emailid = ‘$email’ AND status = ‘1’”;
$res = $Obj->GetAllWhere($table,$where);
if(count($res)>0)
{
$_SESSION[emailid] = $res[0][emailid];
$log[first_name] = $_
SESSION[first_name] = $res[0][first_name];
$smarty->assign(“log”,$log);
}
}

[upl-file uuid=8080e389-9e60-49c7-9d48-179f71eb13ed size=5kB]New Text Document (2).txt[/upl-file]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@legendxJul 15.2008 — You don't say.
Copy linkTweet thisAlerts:
@ZnupiJul 15.2008 — Eat cookie.
×

Success!

Help @mvnr_83 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...