Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 31st Mar 2020, 05:45 PM   #1
HyperActive Warrior
War Room Member
 
Join Date: 2009
Posts: 167
Thanks: 49
Thanked 28 Times in 26 Posts
Default
Looking for simple password system or script
Share on: 
fb share twitter share gplus share more share

Can anyone point me to a simple password script or website that shows how to do something like this...

The user is asked to enter a passcode.

Let's say want to have 3 passwords.....

If a user enters ABC they go to www.aa.com
If a user enters DDD they go to www.dd.com
If a user enters ZYZ they go to www.zz.com
if no match they get an error message


Thanks in advance.

Excel Help - Excel Expert Available To Assist You!
IdeasThatExcel is offline  
Unread 17th Apr 2020, 08:43 AM   #2
You reap what you sow.
War Room Member
 
Nail Yener's Avatar
 
Join Date: 2008
Location: Sometimes you don't.
Posts: 1,078
Thanks: 196
Thanked 411 Times in 243 Posts
Default
Re: Looking for simple password system or script
Share on: 
fb share twitter share gplus share more share

It looks like this is not a username-password thing. You can accomplish a code-based redirection like this by adding some JavaScript to your page:

HTML Code:
<input type="text" id="code" placeholder="Enter Your Code">
<button type="button" id="enter">Enter</button>
<div id="notice"></div>

<script>
var codes = {
	'code1' : 'http://www.google.com/',
	'code2' : 'http://www.youtube.com/',
	'code3' : 'http://www.twitter.com/',
};

document.getElementById('code').oninput = function() {
	document.getElementById('notice').innerHTML = ''
}

document.getElementById('enter').onclick = function() {
	var code = document.getElementById('code').value;
	if (code != '' && code in codes) {
		window.location.href = codes[code];
	} else {
		document.getElementById('notice').innerHTML = '!! Invalid code entered.'
	}
};
</script>
You can add more codes, edit redirect URLs, error message, style the input box and button etc. as you wish.
Nail Yener is offline  
The Following 3 Users Say Thank You to Nail Yener For This Useful Post:
Closed Thread


Bookmarks

Tags
password, script, simple, system


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 11:59 AM.