Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 08-17-2007, 11:57 AM Javascript password
Rusalka's Avatar
Experienced Talker

Posts: 36
Name: Greta
Location: Winchestertonfieldville
Trades: 0
I'll start out by saying I don't know much about Javascript. I took one semester of Java in college which helps me understand the code when I see it, but I have trouble creating my own code from scratch.

Now I know that there are tons of password scripts out there that I can copy and paste, and I have been using my own version on the Gatekeeper code. You can see it here:

www.koiretailer.com/koi.htm

To make it easier on my customers I want the password box on the page itself, not on a popup message or page. I'll keep playing with it, I know I'll get it eventually, but anything you guys can tell me now would be a great help. (and will save some of my hair from being torn out )
Rusalka is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-17-2007, 12:20 PM Re: Javascript password
JamieLewis's Avatar
Pretty Much a Big Deal...

Latest Blog Post:
Gooie
Posts: 385
Name: Jamie Lewis
Location: UK
Trades: 0
Right....firsly you should be doing this with a server side language, you should NEVER use javascript for passwords because it is inaccessible and because everything is done on the client side it is insecure. I took a look at your password script and saw that it seems to be using the good old security through obscurity mentality which never works for long.

For the record, Java and Javascript work very differently in their behaviors and context, so while syntactically they are similar there are many subtle differences.

All you need to do is set up a form on your page (which by the way needs a markup transplant) and then send the data server side to be processed and then set a session to say the customer is logged in, this will give greater customer and site security.

Jamie
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
JamieLewis is offline
Reply With Quote
View Public Profile Visit JamieLewis's homepage!
 
Old 08-17-2007, 12:34 PM Re: Javascript password
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
What Jamie said. Javascript, being a client-side code solution, is not secure and people will figure out the password pretty easily.

Use PHP, ASP, ASP.NET, or something else that's server-side for passwords. Jamie just gave you the best advice on this subject that you're ever going to get.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 08-17-2007, 12:37 PM Re: Javascript password
Rusalka's Avatar
Experienced Talker

Posts: 36
Name: Greta
Location: Winchestertonfieldville
Trades: 0
I'm not looking for complexity. Just a simple password that will keep simpletons out and send to user straight to the "protected" site. I'm not dealing with logins and usernames. What I'm looking for is a way to get the gatekeeper directly *on* the page and not in a popup window.

I've made some headway, now I'm looking for a method or event that will send the user to a webpage. (the go method seems only to work with pages already in the users history)

EDIT: thank you both for your input and it's not lost on me. I'm not looking for true security here because it's only a wholesale site. If someone gets through then, oh well... there's nothing important I'm trying to hide on the other side.

Last edited by Rusalka; 08-17-2007 at 12:40 PM..
Rusalka is offline
Reply With Quote
View Public Profile
 
Old 08-17-2007, 12:52 PM Re: Javascript password
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
That's just it, Rusalka: a server-side solution is no more complex than a client-side solution, and will be more likely to keep stupid people out. The thing with idiots is that they have a way of doing the one thing correctly that will open up the door to allow them to do 100 things incorrectly. If the information is important enough to need to be password-protected, then it should be done properly.

The other option is to configure the server in such a way as to not allow access to that folder, and only allow certain user accounts on the server. I think it's done through .htaccess in Apache, but I'm not sure.

By the way...Mr. Deeds was a good movie.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 08-17-2007, 01:10 PM Re: Javascript password
Rusalka's Avatar
Experienced Talker

Posts: 36
Name: Greta
Location: Winchestertonfieldville
Trades: 0
Haha, yeah it was.

OK, I give up. I know HTML and CSS pretty well now but I always knew I would need to pick up php and asp (along with many other things I haven't delved into). Since you seem to be so adamant in me not using javascript for this I'll take it as an excuse to start reading my php books, which are at home, so I'm botching this assignment for today. Maybe after spending some time on that I'll look back and laugh at my attempts to get this damned assign method to work, lol.

Thanks for the extra push guys, I needed it
Rusalka is offline
Reply With Quote
View Public Profile
 
Old 08-17-2007, 05:11 PM Re: Javascript password
kline11's Avatar
SearchBliss Web Tools

Posts: 1,726
Name: John
Location: USA
Trades: 0
I never list other sites, but for $10 you can get a password script (ASP/VBscript) here http://www.kattouf.com/mypagelock/ but it uses an "include file" so it will only work on ASP pages. This may or may not help. I have baught his products in the past and was very satified. There may be other options as well searching Google...you need to know what server side languages you can run on your server first.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is online now
Reply With Quote
View Public Profile
 
Old 08-17-2007, 06:08 PM Re: Javascript password
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Greta, this is a simple way to do the identification without pulling all your hair out:

As Jamie said, you need a form:
HTML Code:
<form name="frmPwd" action="login.php" method="post">
  <input type="password" name="inpPwdPass"/>
  <br/>
  <input type="submit" value="Login"/>
</form> 
Then, the login.php should be:
PHP Code:
<?php
//First, define the valid password
$validPwd="ThereIsNoPass";

//Get the form passed password
$userPwd=trim($_POST['inpPwdPass']);

//Check them both, and redirect accordingly
if( $userPwd == $validPwd ){
  
header('location:/protected/index.html');
  exit();
}
else{
  
header('location:/someErrorPage.html');
  exit();
}
?>
Obviously, you need to change the error or success landing pages, but this is all you'll need.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 08-23-2007, 05:02 AM Re: Javascript password
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
seeing as you are on IIS

<self-promo>
Site Logon

</self-promo>
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Javascript password
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29081 seconds with 12 queries