SunQuest
           HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 8th, 1999, 12:35 PM
Chriss
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Hi,

I am making a homepage and a certain part of it should be password protected, I found some free JavaScripts that could help, but unfortunately I had to merge two to get a fairly good protection. (Well, the one I use had the actual password in the source code, which is pretty pointless if you ask me!!!)

But I don't know ANYTHING about JavaScript (all I did was put one and one together which got me quite far, although I don't really understood what I did) So, now here's the problem:

if (username=="test" && password=="test") { window.location="test.htm"; done=1; }

This is the command that then opens the new page. I need it to do two things, the "test.htm" should be the value of a form field called "url" and it should only affect a frame.

PLEASE HELP ME!!!

And always remeber, I know NOTHING about JavaScript!

------------------

Reply With Quote
  #2  
Old December 9th, 1999, 05:06 AM
Faz
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
When you want good protection of your pages, CGI or ASP-scripting is almost inevitable. However, there's a way protect specific pages with some simple JavaScript. I used it once my self and I seems to be quiet effective.

just make a page (e.g. index.htm) with the following code:

function loadpage(){
newwin = window.open(document.form.pwd.value + ".htm", target="_self") }

In the page there is a form called "form"
with an object called "pwd" (password box).
Beside the pwd-box, you should place a button
with the following event handler:

onClick='loadpage()'

The page you want to protect should have the name of the password you choose. So, if you want the password to be "letmein" the filename of the page must be "letmein.htm".

Most http server search for an index.htm(l) when opening a specific folder. That ensures you that people can't snoop around the folder like an FTP-directory, an then figure out which files are located in the folder.

Grtz

Faz.

Reply With Quote
  #3  
Old December 9th, 1999, 05:14 AM
Chriss
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Well, thanks, I got that problem solved myself, but this idea isn't even that bad, I might do that.

The way I do it right now is that you simply enter a pessword and username, and if both are compared to the desired combination that is written in the source code, becasue that isn't really save I encrypted the password, once you enter the password it will too be encrypted and THEN compared to the one stored in the source code.
I know it's not the safest, but since it's kinda hard to get the encryption code out of the source code it should work...
(And then, the page isn't TOP SECRET anyway...)
Well, thanks again for helping!
As for the CGI, you know were I can find some good scripts?

------------------

Reply With Quote
  #4  
Old December 9th, 1999, 05:08 PM
me
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
good scripts can be found at:

http://cgi.resourceindex.com/Programs_and_Scripts/Perl/

Reply With Quote
  #5  
Old December 10th, 1999, 05:43 AM
Chriss
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Thanks! I'll check it out! (Especially since my script wasn't NEARLY as good as I thought, I send it to a friend, and well, let's just say all he did was laugh!!!)
Btw, is there a way to make a JavaScript into a file that then is only EXECUTED and not read?
Then I could set the chmod of the file so it can only be executed and not read, which would make it harder to crack...

------------------

Reply With Quote
  #6  
Old December 20th, 1999, 09:37 AM
DGBrothers
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I've been thinking, wouldn't it be possible to just get the source code of a JavaScript password-protected page, paste the code into NotePad, edit out the JavaScript password protection, change any relative links to absolute, and enter the page from the newly edited file? Kind of requires password protection to be a CGI or ASP thing in order to be completely protected.
Could that be done?

Reply With Quote
  #7  
Old December 20th, 1999, 10:06 AM
Chriss
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Well, I stopped working on a JavaScript protecting. I started working on CGI and Perl, and while it's not YET working it's MUCH saver than JavaScript.
If it's done and works fine I might make it available to the public. (All scripts I found basically weren't what I was looking for, they left no room customization.)
Well, I'll drop a note if it's done and available...

------------------

Reply With Quote
  #8  
Old December 20th, 1999, 11:14 AM
EzMan
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
aren't you able to simply use .htaccess files to restrict access???

Reply With Quote
  #9  
Old December 20th, 1999, 05:14 PM
Chriss
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Well, unfortunately the server I have to work on doesn't support .htacess, so I'll have to come up wiht something else which is still pretty save URL

------------------

Reply With Quote
  #10  
Old December 21st, 1999, 01:54 AM
Spookster
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
In my forum we had quite a bit of discussion using JS for password protection. One person created what he thought to be an unbreakable password script but hence we cracked it. He tried another shot at rewritng it and none of us could crack it. It uses JS and encryption and cannot be easily cracked. He has made the script available for download. Ill refer to one of the post in my forum at WSabstract:

http://wsabstract.com/ubb/Forum1/HTML/002980.html

Spookster

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Need help with password protection!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway