Results 1 to 5 of 5

Thread: A good password code for a form

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Posts
    22

    A good password code for a form

    Read the title.
    Last edited by devil200; Jun 28th, 2002 at 08:10 PM.

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Posts
    22
    I mean a good password and login thingy for a form

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Posts
    22
    anyone

  4. #4
    Jethro
    Guest
    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

    Code:
    <%@ 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....

  5. #5
    Jethro
    Guest
    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....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width