Pelle
02-03-2005, 01:25 PM
I want to create an area where only registred users may enter. That is, if someone tries to go directly to "secret1.asp" or "secret2.htm" I want them to be re-directed to the "login.htm" page. I also want the users to be able to navigate between the two protected web pages (by using the two links) without having to login each time. When a user successfully logs on, "secret1.asp" should always be displayed.
The username and password will be checked against a database but I know how to achieve that already. The main problems are how to make sure that the only available route to the two protected pages is through "login.htm" and how to remember a user that navigates between the two protected pages. Is there, by the way, any difference whether the pages in the protected area are static or
dynamic? I guess I should use cookies here, I just don't know how (maybe there is another way too).
Hope you guys can help me out here. I would be really grateful.
//This is "login.htm"
Please enter your username and password:
<form name="form1" method="post" action="secret1.asp">
<p>Username: <Input name="text" type="text" id="text"> </p>
<p>Password: <Input name="pw" type="password" id="pw"> </p>
<p>Input name="submit" type="submit" value="Enter"> </p>
</form>
//This is the "secret1.asp" URL
Some ASP/DHTML code....
// Link to another protected URL
<a href="secret2.htm"> Go to the community page
//This is the "secret2.htm" URL
Some static HTML code....
// Link back to "secret1.asp"
<a href="secret1.asp"> Return to your starting page
The username and password will be checked against a database but I know how to achieve that already. The main problems are how to make sure that the only available route to the two protected pages is through "login.htm" and how to remember a user that navigates between the two protected pages. Is there, by the way, any difference whether the pages in the protected area are static or
dynamic? I guess I should use cookies here, I just don't know how (maybe there is another way too).
Hope you guys can help me out here. I would be really grateful.
//This is "login.htm"
Please enter your username and password:
<form name="form1" method="post" action="secret1.asp">
<p>Username: <Input name="text" type="text" id="text"> </p>
<p>Password: <Input name="pw" type="password" id="pw"> </p>
<p>Input name="submit" type="submit" value="Enter"> </p>
</form>
//This is the "secret1.asp" URL
Some ASP/DHTML code....
// Link to another protected URL
<a href="secret2.htm"> Go to the community page
//This is the "secret2.htm" URL
Some static HTML code....
// Link back to "secret1.asp"
<a href="secret1.asp"> Return to your starting page