6 Replies - 2023 Views - Last Post: 08 February 2011 - 11:40 AM

#1 vip3r4lif3  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 30-July 06

Password Protect Page

Posted 04 August 2006 - 08:00 AM

Description: Put the code under the HEAD tag, than Replace PASSWORD-HERE with your own, than replace SITE-LINK with the home page link.Add this, to put a password for that PAGE so people cant get in without that password.
<<script language="Javascript">
var password; 
var pass1="PASSWORD-HERE"; 
password=prompt('Enter your password in order to view this page!',' ');
if (password==pass1) alert('Correct password, OK to enter!');
else {
  window.location="SITE-LINK"; 
} 
</script>


Is This A Good Question/Topic? 0
  • +

Replies To: Password Protect Page

#2 krator  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 29-January 09

Re: Password Protect Page

Posted 29 January 2009 - 07:41 PM

the code is correct..but it's backwards... must be like this... " <html xmlns="http://www.w3.org/1999/xhtml"> PAGE
Was This Post Helpful? 0
  • +
  • -

#3 EkosDeux  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 27-December 09

Re: Password Protect Page

Posted 04 March 2010 - 11:51 AM

Sweet piece of code, works great.
Was This Post Helpful? 0
  • +
  • -

#4 atulmarkand  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 11-January 11

Re: Password Protect Page

Posted 14 January 2011 - 03:52 AM


Was This Post Helpful? 0
  • +
  • -

#5 atulmarkand  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 11-January 11

Re: Password Protect Page

Posted 14 January 2011 - 03:52 AM


Was This Post Helpful? 0
  • +
  • -

#6 atulmarkand  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 11-January 11

Re: Password Protect Page

Posted 14 January 2011 - 04:12 AM

test
Was This Post Helpful? 0
  • +
  • -

#7 WILDERR  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 15
  • Joined: 07-November 10

Re: Password Protect Page

Posted 08 February 2011 - 11:40 AM

sweet code , thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1