sorry for previous posting

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jauson
Forum Contributor
Posts: 111
Joined: Wed Oct 05, 2011 12:59 am

sorry for previous posting

Post 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
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: sorry for previous posting

Post 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?
Gopesh
Forum Contributor
Posts: 143
Joined: Fri Dec 24, 2010 12:48 am
Location: India

Re: sorry for previous posting

Post 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...
jauson
Forum Contributor
Posts: 111
Joined: Wed Oct 05, 2011 12:59 am

Re: sorry for previous posting

Post by jauson »

thank will try thank you so much
Post Reply