I have two files which has two types of profiles (user and Admin), Now the problem is how do i create a session which if im a user takes me to the user page and when im admin takes me to admin page!!!

I would advise you to create a session variable that stores the user type and then only test for the user type at any given time and redirect to the appropriate page.

$_SESSION['USER_TYPE']='value from database';

//Example redirect
if($_SESSION['USER_TYPE']=='admin')
header('Location: admin_page');
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.