Quote:
quote:Originally posted by doosti
Listen
The thing is you are using
if Session("logged")="yes" then
Session("logged")="no"
and then you have typed
If Session("logged")<>"yes" then
response.redirect("login.asp")
end if
for making the pages protected from any access. Now see that you are using the condition that if session("logged") is not equal to yes....Obviously it is not equal to yes bcoz you are using something wrong which may be bcoz of
if Session("logged")="yes" then
Session("logged")="no"
It means you are checking for the right thing that session is yes...then by your own assigning it "no" which is making the other condition true that is
If Session("logged")<>"yes" then
response.redirect("login.asp")
Try to do it as mentioned below:
if Session("logged")="yes" then
ALLOW THE USER TO VIEW THE PAGE
else
response.redirect("login.asp")
end if
Hope it will help....you are welcome for any further queries!
Farzan Q.
BS(TeleCommunication)
Iqra University.
|
This seems to work the only problem I am having now is allowing the user to view the page. So far I have only got it to work by using this code:
if Session("logged")="yes" then
response.redirect(the protected page)
else
response.redirect("login.asp")
end if
I have tried doing it this way:
<%if Session("logged")="yes" then%>
<html></html>
<%else
response.redirect("login.asp")
end if%>
But this does not seem to work I may be implementing it incorrectly??
Thanks for all your help.