Guest NeDizZ Posted December 22, 2005 Share Posted December 22, 2005 I wanted to ask how do I put a password to my website? I mean when someone comes and wants to access some part of the website, has to type a password first. Then only the people, who to I tell the password, can access.I think it is java scripting, if not, sorry for flood.Sorry for bad english, I hope you understand. Link to comment Share on other sites More sharing options...
real_illusions Posted December 22, 2005 Share Posted December 22, 2005 a simple google search is all you need to get the answers you require.if you get stuck trying to get a code/script to work, then ask us and we can try and guide you through it. Link to comment Share on other sites More sharing options...
Skemcin Posted December 22, 2005 Share Posted December 22, 2005 Actually search this forum first - you'll find this entry:http://w3schools.invisionzone.com/index.php?showtopic=1017Trying to password protect your site with javascript is like telling a thief you locked your car but the keys are on top of the driver side tire.Javascript is a client-side language which means that the code resides on the client PC and the code gets executed there too. So, if you have logic built that protect a page, allI have to do is look through your code (reverse engineer it) and I'll find out how to get in.You will have to use one of two (or both) methods:a.) server side scripting language (php, asp, cold fusion)b.) server directory services (pasword protect at operating system level) Link to comment Share on other sites More sharing options...
smiles Posted December 23, 2005 Share Posted December 23, 2005 If you use Javascript and supposes that your password is Xthen the way to overcome your " firewall" is find solution of the mathematical equation F(X)=Y . They can see your Y and F()in the source code Link to comment Share on other sites More sharing options...
Chocolate570 Posted December 23, 2005 Share Posted December 23, 2005 I don't think that expression would work. More like they could just find "password=''" in your source code. Link to comment Share on other sites More sharing options...
smiles Posted December 24, 2005 Share Posted December 24, 2005 Although Javascript is browser-language , client-side language , we can't think it easy to do and ... to be done anyway , I had tried to do it , and I think very very many function to encode it , Solving must take many times Link to comment Share on other sites More sharing options...
aspnetguy Posted December 24, 2005 Share Posted December 24, 2005 It is actually quite easy.You need a login form and when it is submited you save the login state to a session variable. Then on each page you check the state of the session variable.If it is good you let them proceed if not you redirect them to the login page.ASP.Net uses Forms Authentication, which is a bit more complicated but much more solid. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now