- This topic is empty.
February 11, 2015 at 5:18 am #195576
submit needs to be onsubmit. I re-corrected my post a couple of seconds after I posted the original.
<form onsubmit=”pasuser(this)” name=”login”>February 11, 2015 at 5:21 am #195577
Nearly! It works on an incorrect password (invalid password dialog box) but on a correct password it puts the password into the address bar again. Also the button does not work when the password is correct.February 11, 2015 at 5:22 am #195578
Can you paste the whole script into CodePen again?February 11, 2015 at 5:23 am #195579February 11, 2015 at 5:32 am #195580
Ok, do you onsubmit like this …
And put the following …
Just before the closing last } of your pasuser function.February 11, 2015 at 5:36 am #195582
You sir, are a legend. Thankyou for your time.February 11, 2015 at 5:36 am #195583
It is working now I take it?
Glad I could be of service.February 11, 2015 at 5:37 am #195584
Yes it works perfectly.February 11, 2015 at 5:37 am #195585
Ok good.February 11, 2015 at 8:45 pm #195733
I eventually want to work out how to set up accounts for people and have them type in a unique password for RSVPing online but I’m a way off that at the moment with my knowledge of all this.
Thanks.February 12, 2015 at 1:18 am #195739
If someone with the password wants to share the page it links to then they could just as easily give out the password.
It’s a little bit to stop people from stumbling across it and being given all the details of our wedding. It’s unlikely given the domain name I am looking at using for it but still possible. If someone comes across it looking for something else it’s just another level of security. Yes it’s a weak level but I can’t imagine anyone wanting to get through so bad they would look at the source code. It’s only slightly better than an “enter” button without any sort of password but I’m happy with that.
It’s also because it’s the only way I know how to do it. If I knew an easier way of password protecting the site I’d use that, the more secure the better but it serves its purpose.February 12, 2015 at 4:37 am #195746
Yes quite a bit of knowledge will be needed to implement a proper log in system.
Have you thought about password protecting the directory through .htaccess?
Normally CPanel has the option to password protect directories using .htaccess through a GUI user interface. Provided you have CPanel or similar on your host should be OK.
Alternatively you could code it into the .htaccess file manually.
However there is probably no need to do this, by the sounds of it, the JS password protection will be suitable for your purpose anyway.
- The forum ‘Back End’ is closed to new topics and replies.