PDA

Click to See Complete Forum and Search --> : A good password code for a form


devil200
Jun 27th, 2002, 04:07 AM
Read the title.

devil200
Jun 28th, 2002, 12:57 AM
I mean a good password and login thingy for a form

devil200
Jun 28th, 2002, 08:11 PM
anyone

Jethro
Jun 29th, 2002, 07:21 PM
Not enough info... do you mean a simple Username and password without encryption, or some sort of heavy duty coding ... hey a really simple one for ya



<%@ Page language="VB" %>
<script runat="server">
sub Page_Load(Sender as Object, e as EventArgs)

' If the page has posted back results, then check them
if IsPostBack Then
' Grab the username and password fields
dim strUserName as string = Request("username")
dim strPassword as string = Request("password")

' Write out a success/failure message
if (strUserName = "Joe Smith") and (strPassword = "secret") then
Response.Write("<h2>Log on successful as " & strUserName & "</h2>")
else
Response.Write("<h2>Your username/password were not found.</h2>")
end if
end if

end sub
</script>

<html>
<body>
<h2>Welcome to the Sample Login Page</h2>
<form runat="server">
<table>
<tr>
<td>Username:</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Login">
</td>
</tr>
</table>
</form>
</body>
</html>



Cool huh....

Jethro
Jun 29th, 2002, 07:26 PM
Other than that create a form chuck two textboxes on it and a button.

Call one textbox "txtUser"

Call the other "txtPassword" and change the Password Char to "*".

Name the button cmdOK or whatever. When the user clicks it check that you have something entered in both textboxes and verfiy it's ok....

As Cander stated, not enough info....