tags:

views:

35

answers:

3

Hello Everyone...

Friends i am a newbie in php and trying to learn it more and more...

I am telling you my problem what i am facing

i have a employee signinform which have one username box and one password box with signin button..Now on the action page of this signinform i have given adress of signinvarification form..which matches the entered username and password with the database record.If username and password matches then it shows you have successfully login..otherwise not login...

NOw i have one page in which i have employee pictures..

Now what i want....????

i want that as the employee signin then that login successfully msj does not display and directly the page which have employee pictures displayed..if sign in is successfull(means if password and usermae are matching).

what i can do in this...

i am thinking that on the if condition if username and password matches then after this i have to write the whole code which i have written for employee picture page on the signinvarification form...

is there any possiblitye that simply i give the adress of that employee picture page and as password are matches it directly navigate to that picture page..

plz tell me...I have given u full information which i can give

A: 

This is a simple if/else statement task. If username and password matches what is expected (or a row in a database table) then either redirect to your desired page, or include your desired page.

Martin Bean
yaa u r right actully this point skip out from mind....thanks a lot
Deepak Narwal
No problem. Also, if a user has been authenticated successfully set a key in the session to flag this so users don't have to re-enter their username and password with each page view as aforementioned.
Martin Bean
+1  A: 

Set a session variable to show that they're logged in then send a Location header to the page that will verify the session variable and show the relevant data.

Ignacio Vazquez-Abrams
A: 

Assuming you want to authenticate the user before they get to the protected content, that rather implies that you don't want users whom have not been authenticated to get to the protected content.

Since you don't want valid users to have to re-enter their username and password for every secured page they visit, then the solution is to use sessions - storing both values in the ession and retesting them every time is an unnecessary complication - just set a flag when they have successfully authenticated, then in the secured pages test for the flag.

If you've already got a huge number of scripts you need to protect then you might want to have a look at the auto-prepend ini setting.

C.

symcbean