how to identify user?[SOLVE]
Moderator: General Moderators
how to identify user?[SOLVE]
hi all,
in my work, i already to login-logout, add, update and delete. but my problem now is how, to identify a user, since my work is all about, product information.
-let say, i have a branch in the different location: canada - africa - qatar - australia - usa - japan - chinna-
-each branch their is one user who maintain their product information on the database so that it can monitor by the areal manager. and now how can identify the user that i can monitor each location if how many product they have.
in my work, i already to login-logout, add, update and delete. but my problem now is how, to identify a user, since my work is all about, product information.
-let say, i have a branch in the different location: canada - africa - qatar - australia - usa - japan - chinna-
-each branch their is one user who maintain their product information on the database so that it can monitor by the areal manager. and now how can identify the user that i can monitor each location if how many product they have.
Last edited by jayson.ph on Thu Jun 28, 2012 9:17 pm, edited 1 time in total.
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: how to identify user?
Give a user a 'country code' option to select when they register
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: how to identify user?
can i have a sample code. please..
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: how to identify user?
Code: Select all
<select name="country">
<option value="na">North America</option>
<option value="sa">South America</option>
<!-- other places -->
</select>
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: how to identify user?
Hi all,
and Hi social_experiment, Thank you and i have another questions. i have login page but it can access everything after login. since i want only my record/file that i want to access after login. even if i jump onto another page. please help
and Hi social_experiment, Thank you and i have another questions. i have login page but it can access everything after login. since i want only my record/file that i want to access after login. even if i jump onto another page. please help
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: how to identify user?
Are you refering to a page that can only be accessed after login?jayson.ph wrote:i have login page but it can access everything after login. since i want only my record/file that i want to access after login. even if i jump onto another page.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: how to identify user?
ah yes, exactly.. and now i have a simple log-in it just for beginner like me. i cant get in to a page. x.php
Please help
Code: Select all
$pingsql = "SELECT * FROM tbl_user WHERE usr_name = '".($_POST['iuserlogin'])."' AND usr_pass = '".md5($_POST['iuserpass'])."' AND usr_type = '".($_POST['usr_type'])."'";
$pingresult = mysql_query($pingsql);
if($pingresult)
{
if(mysql_num_rows($pingresult) == 1)
{
session_start();
$_SESSION['auth'] = 1;
setcookie("usr_type", $_POST['usr_type'], time()+(84600*30));
session_write_close();
header('Location:x.php');
exit();
}
else
{
header('Location:y.php');
exit();
}
}
else
{
die("Query failed: .$pingsql");
}- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: how to identify user?
Have a look a the url below; covers the basics of login system writing
viewtopic.php?f=28&t=135287
viewtopic.php?f=28&t=135287
You aren't redirected to this page?jayson.ph wrote:i cant get in to a page. x.php
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: how to identify user?[SOLVE]
thank you social_experiment i get some idea from the link you give.. thank and now it solve.. thank you for the response.Have a look a the url below; covers the basics of login system writing
viewtopic.php?f=28&t=135287