Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Elite Charizard

Elite Charizard Avatar
Previously known as The Terminator™

**
Official Member

38


January 2006
A script. No chapters. Just follow the script.
<script>
/*Password protect a page in 2 seconds.*/
var passwordText="Password, please." //Question on alert.
var passwordHint="No hint, sorry." //The hint, leave default if none.
var Password="*cough*"//The password (change it)
var right="Correct!!!" //The alert you wan't when password is correct.
var Wrong="http://¿¡!?.com/somepage.shtml" //Url to the page when password is wrong
/***************************
*********Don't edit below******
***************************/
var passwordProte=prompt(passwordText+"","Hint: "+passwordHint);
if (passwordProte==Password)
{
alert(right);
}
else
{
window.location=Wrong
}
</script>

Ok, if you wan't the code to redirect you to another page,
REMOVED - ADDED TO CODE
You must add this to the end of the page:
</span>

And there, rated .
The Terminator


Last Edit: Mar 30, 2006 16:32:22 GMT by Elite Charizard
Don't click Here!
<script>
/*Fooling signature
By The Terminator*/
var Spelling="Signature" //Spelling of Signature
/*Don't edit*/
document.write("Sig" + Spelling + "ture")
</script>
SigSignatureture!
thepokeforums.proboards79.com

Singular

Singular Avatar
v4 Studios :: Coming Soon

***
Dedicated Member

238


September 2005
They can just disable JavaScript. :P

Htaccess is always best for websites. In fact, I think that you can put a restricted image on your website so If they get the password wrong, it will say "Forbidden".
Further Solutions :: Hosting :: Scripts :: Templates
furthersolutions.com

v4 Studios - Coming soon

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Best way is PHP too. My opinion anyway.

Llanilek

Llanilek Avatar
Former Elite Mod

****
Dedicated Studio Member

931


October 2005
php is good for password protection.. but you can't beat .htaccess :P

.htaccess file


AuthName "Section Name"
AuthType Basic
AuthUserFile /full/path/to/.htpasswd
Require valid-user


.htpasswd file

username:password


to add a new user add a new line in .htpasswd with username:password

you change username to your username and password to your password keep the :


Last Edit: Feb 1, 2006 1:56:17 GMT by Llanilek

Singular

Singular Avatar
v4 Studios :: Coming Soon

***
Dedicated Member

238


September 2005
So that is how it works. ;D
Further Solutions :: Hosting :: Scripts :: Templates
furthersolutions.com

v4 Studios - Coming soon

Elite Charizard

Elite Charizard Avatar
Previously known as The Terminator™

**
Official Member

38


January 2006
Well... it's just for those pages who don't have much importance... like whose birthday is it today?
Don't click Here!
<script>
/*Fooling signature
By The Terminator*/
var Spelling="Signature" //Spelling of Signature
/*Don't edit*/
document.write("Sig" + Spelling + "ture")
</script>
SigSignatureture!
thepokeforums.proboards79.com

Gunny

Gunny Avatar
Go Team Tux!

**
Official Member

37


November 2005
A nice simple PHP password script:


<form name="input" method="post"
action="<?php echo $_SERVER['SCRIPT_NAME']?>">

<p><label for="code">Type the code you reviced: </label>
<input type="text" name="code" id="code" /></p>
<p><input type="submit" name="submit" value="submit" /></p>
</form>
<?php
//affirm and neg echo varibles
$entry ="
<script>
alert('Entry Code Confirmed! Press Okay to enter.');
location.replace('http://localhost/yak/clubyak.php');
</script>
";

$noentry ="
<script>
alert('Entry Code Inncorrect! Bad luck');
location.replace('http://www.google.com');
</script>
";

//grab text box
if (isset($_POST['submit'])) {
$name = $_POST['code'];
//if yes

if($name == 232 || $name == 343 || $name == 565) {
echo $entry;
}
//if no
else {
echo $noentry;
}
}
?>


You'd have to use htaccess or something to stop people just typing in a URL though.

Curious George®

Curious George® Avatar
Music Lover

****
Senior Member

318


October 2005
after much hair pulling with Neil, he has convinced me that .htaccess is the best way even if it has a stupid pop up :P


Grab this Headline Animator

Moose

Moose Avatar

****
Senior Member

449


August 2005
PHP is the way to go like the rest said. Besides they can view the source or disable JS.
Greg says:
Coding music...
Greg says:
Hmm...
Greg says:
I wouldn't rule it out. :P
Chris 3.0 [New features? Yes.] says:
:P
Greg says:
If you think about machine code it's a bunch of 1s and 0s
Chris 3.0 [New features? Yes.] says:
Anything is possible.
Greg says:
Yeah try to code Metallica
Chris 3.0 [New features? Yes.] says:
:P Yeah, I'll get right on that... right after I learn to fly.

Elite Charizard

Elite Charizard Avatar
Previously known as The Terminator™

**
Official Member

38


January 2006
moose said:
PHP is the way to go like the rest said. Besides they can view the source or disable JS.
That's why I said it was for small, not-importantant pages.
Eg: The solution to a question. If right, you will see something, if wrong, you will go to Google.
Don't click Here!
<script>
/*Fooling signature
By The Terminator*/
var Spelling="Signature" //Spelling of Signature
/*Don't edit*/
document.write("Sig" + Spelling + "ture")
</script>
SigSignatureture!
thepokeforums.proboards79.com

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
And then they just disable JAvaScript. :P

Llanilek

Llanilek Avatar
Former Elite Mod

****
Dedicated Studio Member

931


October 2005
exactly.. so its just dumb... lol and with javascript being client side they can view the source n get the pass anyways... lol


Last Edit: Mar 20, 2006 0:30:52 GMT by Llanilek

Elite Charizard

Elite Charizard Avatar
Previously known as The Terminator™

**
Official Member

38


January 2006
Ok, CODE UPDATED. Now there's only one way to get the password, and that is, disable JS...
Once again, I repeat, this is just for pages which don't need importance!!!

REMOVED - ADDED TO FIRST POST


Last Edit: Mar 30, 2006 16:27:52 GMT by Elite Charizard
Don't click Here!
<script>
/*Fooling signature
By The Terminator*/
var Spelling="Signature" //Spelling of Signature
/*Don't edit*/
document.write("Sig" + Spelling + "ture")
</script>
SigSignatureture!
thepokeforums.proboards79.com

Llanilek

Llanilek Avatar
Former Elite Mod

****
Dedicated Studio Member

931


October 2005
still doesn't make it anymore secure ....

Elite Charizard

Elite Charizard Avatar
Previously known as The Terminator™

**
Official Member

38


January 2006
Why doesn't anyone understand?
Don't click Here!
<script>
/*Fooling signature
By The Terminator*/
var Spelling="Signature" //Spelling of Signature
/*Don't edit*/
document.write("Sig" + Spelling + "ture")
</script>
SigSignatureture!
thepokeforums.proboards79.com

newBookmarkLockedFalling