SamohtVII Posted May 9, 2013 Share Posted May 9, 2013 Just wondering if this is secure or not to leave on a web page. Not really sure how security and things like passwords on sites work/are protected so any info would be great thanks... <script type="text/javascript">var password;var pass1 = "password"; // place password herepassword=prompt("Please enter your password:","");if (password==pass1) {window.location= "correct.html"; // file to open if password is correct} else {window.location= "wrong.html"; // file to load if password is incorrect}</script> ty Link to comment Share on other sites More sharing options...
Don E Posted May 9, 2013 Share Posted May 9, 2013 That would not be secured because anyone can view that by viewing the source through the browser and see what the password is. It is recommended for passwords to be processed/handled on the server side. Link to comment Share on other sites More sharing options...
SamohtVII Posted May 10, 2013 Author Share Posted May 10, 2013 So how would I go about this. I have used htaccess and pw but I don't want it to protect the whole website just certain pages that I choose. Is this still possible to do that with ht?ty Link to comment Share on other sites More sharing options...
Ingolme Posted May 10, 2013 Share Posted May 10, 2013 You need a server-side language, such as PHP or ASP.NET. Link to comment Share on other sites More sharing options...
SamohtVII Posted May 11, 2013 Author Share Posted May 11, 2013 Yeah i got php set up and everything just would like something to search for like a keyword or something to help. I'm pretty new to all this is all :S ty 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