Page 1 of 1

sorry for previous posting

Posted: Tue Oct 25, 2011 6:50 am
by jauson
Hi,

I really need your help badly.

Please help me to create a script.
I have created a database with table `employee`
employeeid
fname
lname
mi
designation
salary
username
password


I have created 2 forms, login_form.php and profile_form.php.
I want to see my profile when I login. I dont have an idea to do that.
Please help thanks

Re: sorry for previous posting

Posted: Tue Oct 25, 2011 6:56 am
by Celauran
It's pretty straightforward. Query the employee table based on the username and password provided in the login form. If it returns a result, the credentials are good, so set some cookie and/or session data and forward the user to the profile page.

What have you got so far?

Re: sorry for previous posting

Posted: Tue Oct 25, 2011 7:10 am
by Gopesh
Hi,Celauran made it right. Firstly check the entered username and password matches with that of the stored one in database.if it is success,store the username to a session variable like

Code: Select all

$_session['username']=$username;
then redirect to profile page using

Code: Select all

header(Location:profile.php);
At the profile page start the session first with session_start() and using the stored session variable($_session['username']) pull out the other values from the table.
Hope it helps...

Re: sorry for previous posting

Posted: Tue Oct 25, 2011 8:51 pm
by jauson
thank will try thank you so much