Hello this is my first post and i want to make a web app for a scavenger hunt/game im organizing. This app is offline and needs to have a password for each hint. Is there a way to have a prompt show up asking for a password or something similar while remaining offline? it doesnt have to be too secure and the password could be in the code, i just want to know how to do it. Thank you
Ok, I don't think you could do this with pure html, however if you can enable javascript in your app try this method: (I don't know javascript, but this should be similar to what you need)
<script>
function logincheck(form) {
if(form.id.value=="user") {
if(form.pass.value=="password") {
location="yourdesiredpage"
}
else {
alert("FAILED ATTEMPT!!! DESTROYING APPLICATION, FORCING PAYMENTS!!") //well don't say that lolz
}
}
}
/*
*Now if you don't want username, just delete the first if statement and a closing }
*/
</script>
/*
* This probably isnt write comment method (im a c++ guy), anyways,
* the above should be near close to javascript I think. but what that does
* is if the username is correct, then it will check password, if thats good
* user will get redirected. If bad, user gets alerted. Now for the form
*/
/*
* If that doesn't work, try puting value="" in the input names
* Otherwise, it should be close or actually work. If you need
* help enabling javascript on a platform where webapp is, let
* me know and I can try to help you on that.
*/
Thank you. After a bit of tweaking it pretty much worked. The one thing that didn't work so well though was the location="yourdesiredpage" I don't know why, but I can get it to navigate to any page once I use that. I know I'm suppose to Id my pages in HTML, but could someone explain how to use the location="x"
Bookmarks