I want to create a single login page for Admin and user.When admin lo it should go to seperate page and when user log it shoult go to seperate page.I want sample code for this.Thanks..
vindyauwu
0
Newbie Poster
Recommended Answers
Jump to Post1) In you users table store the user type
2) while checking for loging creadentials against database, if username and password is correct, check the usertype.
3) if admin redirect to admin page, if user, redirect to user page
4) and do store the usertype in session for checking on …
Jump to PostI dont have. You can post your code, whatever you have done till now and then people can tell you the modifications. Chances of someone giving you the entire code tailored to your need are very less.
Jump to PostYou aren't getting the data from your query. mysql_num_rows returns exactly what it says, the number of rows returned from a query - therefore it cannot be equal to a strings, only an integer.
Change to:
$query = mysql_fetch_array($login); // Check username and password match if ($query['user'] …
Jump to Post@andyy121,
You may not be aware of general forum accepted practices, but you may want to consider starting your own thread if you need help rather than hijaking someone else's.
Jump to Posttell me how i insert data in to data base, how to select the data in the database
There are many many tutorials on the web that cover this very basic information. Nobody here is going to write a new one just for you. Do some research of …
All 23 Replies
ckchaudhary
5
Newbie Poster
vindyauwu
0
Newbie Poster
ckchaudhary
5
Newbie Poster
vindyauwu
0
Newbie Poster
simplypixie
123
Posting Pro in Training
vindyauwu
0
Newbie Poster
simplypixie
123
Posting Pro in Training
diafol
andyy121
-9
Junior Poster
JorgeM
958
Problem Solver
Team Colleague
Featured Poster
vindyauwu
0
Newbie Poster
diafol
anjalis683
0
Newbie Poster
simplypixie
123
Posting Pro in Training
diafol
vindyauwu
0
Newbie Poster
sultankhan
0
Junior Poster in Training
diafol
amit_48
0
Newbie Poster
benanamen
commented:
Hijacked 5 year old thread.
+0
amit_48
0
Newbie Poster
benanamen
commented:
You hijacked a 5 year old thread with obsolete, dangerous code.
+0
Imran_22
-3
Newbie Poster
JamesCherrill
commented:
Lazy, entitled.
-3
benanamen
commented:
This is a 5 year old thread you hijacked. Start your own thread and show some effort.
+0
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
VINITHAPRIYA R
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.