Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 [Tutorial] Password Protecting Your Pages
Index -> Graphics and Design, Web Design -> (X)HTML Tutorials
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
void




PostPosted: Sun May 25, 2003 4:19 pm   Post subject: [Tutorial] Password Protecting Your Pages

This is a VERY simple way to pass protect your web page..not very attractive but it works
code:

<html>
<head>
<title>password 1</title>
<script LANGUAGE="javascript">
var wrong="pass1.htm";   
// password...   
var password="WHAT";   
// prompts the user this...   
var name = prompt("WHAT is the password???","");   
// if... else statement... right, confirm this, wrong, go to wrong...   
if (name == password) {(confirm("Welcome!"))}   
else {location.href=wrong}
</script>
</head>
<body>
<p>
YOU HAVE CORRECTLY GUESSED THE PASS WORD
</body>
</html>

The password is "WHAT" copy the program to ur text document and save as pass1.htm NOT pass1.html, if you do then change the variable wrong to pass1.html because thats the site that its redirected to when the pass is wrong

Edit:
Note: THIS IS NOT A FOOLPROOF METHOD!!!
It is easy to bypass, If you very important things to protect, use .ht access & .htpasswd, as it is harder to get through. But if it is not available, I guess this will have to do
Sponsor
Sponsor
Sponsor
sponsor
JSBN




PostPosted: Sun May 25, 2003 4:28 pm   Post subject: (No subject)

while u did forget my little warning which i added, it is good. +5
void




PostPosted: Sun May 25, 2003 4:32 pm   Post subject: (No subject)

i thought ppl would realize that coz i said "VERY simple" program...as in it not very complex encrypting..thus making it easy to bypass, in fact, if your smart enough, you can save the web page to your desktop, then edit the page and remove the pass script and then reload the site.....(beginners hacking...lolz)...ill save the MODS breath

MY EDIT: WE DO NOT ENCOURAGE HACKING, IN FACT WE CONDEMN IT EVEN THO MORE THAN HALF OF US DO IT Wink LOLZ (you cant sue us now!!)
PHP God




PostPosted: Mon May 26, 2003 6:55 am   Post subject: (No subject)

I would have taken bits. He just practically taught us all how those little passwrods work that PPL have on geocities. jk man. I've seen that tut b4 tho.
octopi




PostPosted: Mon May 26, 2003 10:33 pm   Post subject: (No subject)

Best way, is to use apache itself

Make a '.htaccess' file


code:
AuthType Basic
AuthUserFile /path/to/your/directory/.htpasswd
AuthName "Members Area"
require valid-user


you will need to encrypt the password using the crypt function of Perl.
http://www.hof-berlin.de/crypt.php3
will do it for you.
Homer_simpson




PostPosted: Mon May 26, 2003 10:45 pm   Post subject: (No subject)

how to hack a page protected that way :
open the page goto view > source copy and paste the page and remove the password part... i think that would do =/
JSBN




PostPosted: Tue May 27, 2003 6:52 am   Post subject: (No subject)

actually... homer, .htpasswd & .htaccess files are a little more complicated than that. because there will still be a .htacess file on the server. You cant remove it.
Homer_simpson




PostPosted: Tue May 27, 2003 7:26 am   Post subject: (No subject)

no, i'm talking about the first way that was mentioned...
Sponsor
Sponsor
Sponsor
sponsor
CHUTHAN20




PostPosted: Fri May 28, 2004 7:59 pm   Post subject: simple

visit this address to almost evrything.


[url]http://www.dynamicdrive.com
[/url]
blackwhite




PostPosted: Tue Jul 13, 2004 5:30 pm   Post subject: (No subject)

hotscripts has some cool pwd protecting scripts. actually, they have everything.
Display posts from previous:   
   Index -> Graphics and Design, Web Design -> (X)HTML Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: