/    Sign up×
Community /Pin to ProfileBookmark

Adding username and password Help!

For some reason no one seems to want to help me as i contribute fairly to people who needs help, or this is a really hard question:

[QUOTE]

<html>
<head>
<title>Page 1</title>
<style type=”text/css”>
div { text-align: left }
#container{ text-align: center; margin: 25% auto; width: 250px; border: 1px solid black; padding: 25px; }
.clear{ clear: both }
.field-name{ position: relative; float: left }
.field-value{ position: relative; float: right }
</style>
</head>
<body>
<form method=”GET” action=”page2.html”>
<div id=”container”>
<div class=”field-name”>Name:</div><div class=”field-value”><input type=”text” name=”firstName” value=””

/></div>
<div class=”clear”></div>
<div class=”field-name”>Password:</div><div class=”field-value”><input type=”password” name=”pw” value=””

/></div>
<input type=”submit” value=”Go To Next Page” />
</div>
</form>

[/QUOTE]

Please could someone add the code to this so only the username and password which is in the code can access the page aswell as able to have multiple members.
please dont change it to a securer peace of code,please kee the code the same.
thanks allot to whoever takes the time out to help me.

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@toicontienJun 25.2007 — You can't do this with JavaScript. You need a server side solution. Do you know what scripting languages your web host supports?
Copy linkTweet thisAlerts:
@mitchellauthorJun 25.2007 — Hi toicontien, i think that they support all types, such as .js .php .html

where you thinking of mysql as i find that difficult.
Copy linkTweet thisAlerts:
@toicontienJun 25.2007 — Perhaps you're thinking of JSP instead of JS? JavaScript is typically a client side scripting language that only runs in the browser, though some web hosts might have it installed as a server side language. JSP is Java Server pages, which is an offshoot of Java, which is completely different from JavaScript.

As for how to store the usernames and passwords... You should be able to do this using normal files. You'll want to create a new file for each user, which will contain their user info. Be sure to encrypt the password. Try out the PHP forum with this question. If you don't want to use a database, you should be able to use a flat file system and be able to encrypt the password. But you've got to store the user info in a directory that is not accessible to a Web browser, and only accessible to your server side script.
Copy linkTweet thisAlerts:
@mitchellauthorJun 25.2007 — thanks, i really only want it in the same code as shown, as i have a decripter to decript its content, and just want to know how to put usernames and passwords in the code above?

thanks for helping me out
Copy linkTweet thisAlerts:
@toicontienJun 25.2007 — If you put a user name and password in client side code, it will take me less time to hack your site than for you to make a sandwhich. NEVER NEVER NEVER do user authentication with JavaScript. ALWAYS do it with a server side script. I don't mean to come off as harsh, but it's the plain truth.
Copy linkTweet thisAlerts:
@mitchellauthorJun 25.2007 — although i KNOW its not safe please could you tell me how to add usernames and passwords to that code, preetty pleeese
Copy linkTweet thisAlerts:
@toicontienJun 25.2007 — I won't. I will not knowingly contribute non-secure code. When you've got a username and password box, people assume it's going to be secure, in that you can't hack it and get ahold of your password. When people sign up for stuff, they tend to use usernames and passwords they use elsewhere. I guarantee that you'll have unencrypted usernames and passwords that people also use for the ebay, amazon.com, and email accounts. Bank accounts even. Although this is the fault of the user, you must account for common behaviors. And using one username and password across many different sites is a common behavior. Just don't do it.

It's not that hard to get a server side solution going. Head to the PHP or Perl forums here. They will either help you code a solution, or point you toward free scripts you can use. Do not use JavaScript authentication on the client.
×

Success!

Help @mitchell spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...