set session?
Posted: Sun Jun 17, 2012 9:05 pm
hi all,
i have code for login.php below and it work okay and i get in. but my problem now is where should i put the session code to start and to destroy it:
into page: branch_view.php or
here in login.php
Please help
i have code for login.php below and it work okay and i get in. but my problem now is where should i put the session code to start and to destroy it:
into page: branch_view.php or
here in login.php
Code: Select all
$pingsql = "SELECT * FROM tbl_user WHERE usr_name = '$valusename' AND usr_pass = '$valpasswrd'";
$pingresult = mysql_query($pingsql);
$pingrowscount = mysql_num_rows($pingresult);
if($pingrowscount == 1)
{
session_register('usr_name');
session_register('usr_pass');
header('Location:../public-functions/branch_view.php');
}
else
{
header('Location:../login_function/error_login_function/logerror.php');Please help