New here, Javascript password protect site not working on mobile

Joined
Oct 12, 2021
Messages
3
Reaction score
0
Hi there! I recently created a weebly site (herphusbandry.weebly.com). I am thinking about starting a Patreon, and for one of the perks I was going to create a password-protected site with exclusive content, and only give the password to my Patrons. I found this JavaScript code online for password protecting the site, and it works fine on desktop devices when I put it in the header code, but not on mobile. Any ideas?

<SCRIPT language="JavaScript">
<!--hide

var password;

var pass1="HerpHusbandry";

password=prompt ('Please enter your password to view this page! - Hint its HerpHusbandry',' ');

if (password==pass1)
alert ('Password Correct! Click OK to enter!');
else
{
window.location="https://wronghhpassword.weebly.com/";
}

//-->
</SCRIPT>

(P.S., I will change the password before continuing!)
 
Joined
Nov 13, 2020
Messages
302
Reaction score
38
JS does a piss poor job of protecting a site. You need a database and a server side language like PHP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,056
Messages
2,570,443
Members
47,090
Latest member
LillieRipl

Latest Threads

Top