March 28, 2024, 03:27:26 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Revolution X, where Coding meets Graphics.
 
  Home Help Search Arcade Affiliates Staff List Calendar Members Login Register  

Password Protect Webpage

Pages: [1]   Go Down
  Print  
Author Topic: Password Protect Webpage  (Read 458 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
Tenth year Anniversary Nineth year Anniversary Search
« on: June 15, 2009, 08:16:42 pm »

Footers:
Code:
<script type="text/javascript">
function PassProWeb(p,w){
if(location.href.match("/" + p + ".php") || location.href.match("ezportal;sa=page;" + p) && !location.href.match("pass=" + w)){
document.getElementById("bodyarea").innerHTML = "<div class='tborder' id='PassProWeb'><div class='catbg' st" + "yle='padding: 6px; vertical-align: middle; text-align: center;'>Board Protected</div><div><table border='0' width='100%' cellspacing='1' cellpadding='4' class='bordercolor'><tr><td class='windowbg2' width='100%'><center><br><i>Enter Password:<br>(Password is Case Sensitive)</i><br /><input type='text' id='ppw' /><br /><br /><input type='button' onclick='PressMe(\"" + w + "\");' value='Enter' /></center></td></tr></table></div></div>";
};};
function PressMe(pW){
var pw = document.getElementById("ppw");
if(pw.value == pW){
if(location.href.match(/\/pages\//i)) window.location.href = window.location.href + "?pass=" + pW;
if(location.href.match(/ezportal;sa=page;p/i)) window.location.href = window.location.href + ";pass=" + pW;
}else if(pw.value == ""){
alert("Enter a Password");
}else{
alert("Password is incorrect");
};};
PassProWeb("PAGE","PASSWORD");
</script>

Original request:http://revolutionx.smfforfree3.com/index.php/topic,695.0.html

This code lets you add a Password, that is case sensitive, to a webpage you have created.  It works in either the Webpage Editor webpages, or the ez-portal pages Smiley

PAGE = The name of the page,
 - If you want to use the Webpage Editor Page, use the Name of the webpage.  You need the correct name too, so go to that webpage and look at the URL, you will see something like this:
Quote
The red text is the text that you will put for the name of the webpage.
 - If you want to use the ezPortal page, go to it and you will see something like this:
Quote
Again, the red text is the part you would put for the name part.
PASSWORD = The password for that page.  The password is case sensative.

Here are two examples of how to edit the code:
Code:
PassProWeb("test","moose");
PassProWeb("p=1","Agent");

Also, to add more pages to protect, add more of these lines:
Code:
PassProWeb("PAGE","PASSWORD");

Enjoy Smiley
« Last Edit: June 16, 2009, 08:03:35 am by Agent Moose » Report Spam   Logged


Share on Facebook Share on Twitter

Andrew
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 539



View Profile WWW
Badges: (View All)
Combination Topic Starter Poll Voter
« Reply #1 on: June 15, 2009, 10:10:43 pm »

Hmm...here is the one im using, its not working:
Code:
<script type="text/javascript"><!--
function PassProWeb(p,w){
if(location.href.match("/" + p + ".php") || location.href.match("ezportal;sa=page;" + p) && !location.href.match("pass=" + w)){
document.getElementById("bodyarea").innerHTML = "<div class='tborder' id='PassProWeb'><div class='catbg' st" + "yle='padding: 6px; vertical-align: middle; text-align: center;'>Board Protected</div><div><table border='0' width='100%' cellspacing='1' cellpadding='4' class='bordercolor'><tr><td class='windowbg2' width='100%'><center><br><i>Enter Password:<br>(Password is Case Sensitive)</i><br /><input type='text' id='ppw' /><br /><br /><input type='button' onclick='PressMe(\"" + w + "\");' value='Enter' /></center></td></tr></table></div></div>";
};};
function PressMe(pW){
var pw = document.getElementById("ppw");
if(pw.value == pW){
if(location.href.match(/\/pages\//i)) window.location.href = window.location.href + "?pass=" + pW;
if(location.href.match(/ezportal;sa=page;p/i)) window.location.href = window.location.href + ";pass=" + pW;
}else if(pw.value == ""){
alert("Enter a Password");
}else{
alert("Password is incorrect");
};};
PassProWeb("p=4","PASSWORD");
</script>

It was for this page: http://pic.smfforfree4.com/index.php?action=ezportal;sa=page;p=4
Report Spam   Logged

Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
Badges: (View All)
« Reply #2 on: June 16, 2009, 01:57:08 am »

Awesome code! won't use though. Not many Hackers on my site  Wink And btw most of my friends that have SMF forums use it
Report Spam   Logged






Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
Tenth year Anniversary Nineth year Anniversary Search
« Reply #3 on: June 16, 2009, 08:03:30 am »

First post edited.

The code should work now andrew Smiley
Report Spam   Logged


Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy