473,696 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Script for password

24 New Member
I have a <form></form> set up on my web page for passwords. i want to make it so only one password would work. how can i do that in javascript??
Mar 22 '07 #1
15 1772
AricC
1,892 Recognized Expert Top Contributor
I have a <form></form> set up on my web page for passwords. i want to make it so only one password would work. how can i do that in javascript??
Do you want to make the password secure? If so javascript isn't the way to go. You would basically use javascript to check for validation and if you have the user verify the password you can use javascript to check that both inputs are the same.
Mar 23 '07 #2
codeex
24 New Member
It dosent need to be secure, i have 2 pages that have a password box, and i just want to make it so only one password works on the page and when they type it in it will go to another page.
Mar 23 '07 #3
AricC
1,892 Recognized Expert Top Contributor
It dosent need to be secure, i have 2 pages that have a password box, and i just want to make it so only one password works on the page and when they type it in it will go to another page.
So when you type the password in if it is correct you want it to go to another page?
Mar 23 '07 #4
codeex
24 New Member
yes
and if its wrong to stay on the same page
Mar 23 '07 #5
AricC
1,892 Recognized Expert Top Contributor
It dosent need to be secure, i have 2 pages that have a password box, and i just want to make it so only one password works on the page and when they type it in it will go to another page.
People don't usually do this that is why we are asking so many questions. You do realize that the entire world can right click and view the source to see this password?

Here is an example:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2.     <html>
  3.         <head>
  4.             <title>Coming...</title>
  5.                 <script type="text/javascript">
  6.         function CheckMe()
  7.         {
  8.         var strPassword = document.getElementById("strPassword").value
  9.         if (strPassword == "New England Clam Chowder")
  10.             {
  11.                 window.location="http://google.com"
  12.             }
  13.             else
  14.             {
  15.                 alert("No Way Jose")
  16.             }
  17.         }
  18.  
  19.  
  20.  
  21.  
  22.         </script>
  23.         </head>
  24.             <body>
  25.         The Password Is: New England Clam Chowder
  26.                   <form>
  27.             <input type="password" id="strPassword" size="25" />
  28.             <br />
  29.             <input type="button" onclick="CheckMe()" size="25" value="Submit" />
  30.         </form>
  31.             </body>
  32. </html>
  33.  
Mar 23 '07 #6
iam_clint
1,208 Recognized Expert Top Contributor
you could do a md5 hash

http://pajhome.org.uk/crypt/md5/
Mar 23 '07 #7
codeex
24 New Member
yes i do realize that its not import information im trying to guard its more of a block.

But how could i make it more secure??
Mar 23 '07 #8
AricC
1,892 Recognized Expert Top Contributor
yes i do realize that its not import information im trying to guard its more of a block.

But how could i make it more secure??
Check out Clint's solution above I think it would be more than adequate for what you are trying to do.
Mar 23 '07 #9
codeex
24 New Member
thank you for your help
Mar 23 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

10
6008
by: Max | last post by:
Hello all, I am trying to protect a page within my site with a JS password scheme. Now I know JS can be quite easily "circumvented", but I came by a code below. My question is: 1. Is there a way to find a password for this script? How easily? 2. Is there a stronger scheme available in JS?
0
518
by: soundchaser | last post by:
I'm looking for a simple but complete example of creating a VB.Net ActiveX / COM component from a C Library. One should be able to use it by calling the Server.CreateObject method from an ASP script. I have already figured out how to do most of it, but I'm stumped on the part where I call it from an ASP script. Assume I have a VS.Net solution with three projects: 1. CLibrary - generates a DLL from the following C source code:
9
2205
by: Jerim79 | last post by:
I am no PHP programmer. At my current job I made it known that I was no PHP programmer during the interview. Still they have given me a script to write with the understanding that it will take me a while (This information is just for general knowledge as I don't want anyone thinking I am trying to be dishonest with my intentions. Also, I do not portray myself as something I am not. I am a beginner.) Anyway, what the script needs to do is...
9
20894
by: 8anos | last post by:
Hello, I am new at the community and newbie at programming :) As you may know rapidshare provides a perl script for linux, to upload files at their servers. You can find the original scripts at rapidshare news : http://images.rapidshare.com/software/rsapi.pl If you test it you will see that you can upload one file at time. I try to modify it in that way that script can read a text file with the names of the files i want to...
2
1927
by: Nosferatum | last post by:
This script is meant to limit access by sessions, using username and password from mysql db and redirect users after login according to a given value belonging to each user in the db (10,20,30,40). (the included config is just server settings, the login is just a login form). The script appear to connect but will not redirect users, it seems that even with correct login details, it won't validate.
1
4881
by: Andrew Murray | last post by:
I'm a novice at coding and cannot get the script below to work I'm receiving an Error 500 in the web browser when trying to run this script. The site is www.murraywebs.com and the link is 'Retrieve Password' under the logon form. the idea is to submit an email address and the password is emailed to the user. (a very "basic" but common function of user management systems). The script(s) I'm using are based on...
5
1681
by: silmana | last post by:
hello, i have this problem that i cannot bound the registration script to the login script, what i mean is that when i register, i cannot login in the login script although the information comes to the database. Could someone help me with it just create a registration script (username,password,confirm password) and bound it to my login script so that when i register i can log in? here is my database table: CREATE TABLE users ( username...
3
1886
by: Faisal Shah | last post by:
As the solution.. I have got this script code.. it's an open source so i can modify it.. The problem is it's a guest book script written in very highly and deeply php language that I am not able to understand all.. BUT I am here you guys can read and help me.. From this script i would need your help, You will have to separate 2 things <PLEASE> 1. Bunch of code, Which writes message and gives a unique id to each entry...SO identified...
82
10024
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a) html b) perl script (print and inserting into database) Cheers... Andrew
3
12060
by: bollweevil | last post by:
Hello Everyone, I do Django web development on my Mac at home, and then I rsync the files with the Ubuntu web server. I want to write one single bash shell script that rsyncs the files and restarts Apache on the server. Here is the script I have so far, sync.sh: #!/bin/bash echo -n Password: read -s PW rsync --compress --times --perms --links --recursive --delete --include-from=incls.txt --exclude "*" /User/bollweevil/django-site/*...
0
8656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8592
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8846
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4351
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4605
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3025
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2306
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.