Solved

login script

Posted on 1998-08-21
7
160 Views
Last Modified: 2012-05-04
the best login method for my web site security like that on this site, using asp?
0
Comment
Question by:pmaderia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 10

Expert Comment

by:MasseyM
ID: 1836899
On some of my sites, I have a dataase that is securely stored on the server... The use  r then inputs a name & password..I connect to the database and verify both... It is not like this site, but it works just the same... Interested in the code?  If so, let me know...

0
 
LVL 10

Accepted Solution

by:
MasseyM earned 50 total points
ID: 1836900
Ok, I decided to post my ASP... It is not pretty, but it serves its purpose, at least for me...

-------------------------------------------------
This is the Login Form:

<%
=Request.Cookies("Logininfo")("NameFirst")
%>

<CENTER>
<FORM ACTION="Verify.Asp" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME = "Type" VALUE="Login">
<TABLE COLS = "2" ALIGN = CENTER WIDTH = 100%>
      <TR>
      <TD>
      <CENTER>
            <TABLE WIDTH = "50%">
            <TH COLSPAN = "3" BGCOLOR = "Wheat">Login Information</TH>
            <TR>
            
                  <TD COLSPAN = "3"><FONT SIZE = "+2">W</FONT>elcome to the user information area. Please login below using your email and password.  If you haven't created an account yet, enter your email and a password then press "New User"</TD></TR>

            <TR>
                  <TD>Email Address:</TD><TD><INPUT TYPE="TEXT" NAME = "LoginUser" VALUE = "<% =Request.Cookies("LoginInfo")("EMail") %>" SIZE="15"></TD></TR>
            <TR>      
                  <TD>Password:</TD><TD><INPUT TYPE="PASSWORD" NAME = "LoginPassword" VALUE = "" SIZE = "15"></TD></TR>
            <TR COLSPAN = "3" ALIGN = "RIGHT">
                  <TD COLSPAN = "3" ALIGN = "CENTER"><INPUT TYPE="SUBMIT" NAME="SubmitType" VALUE = "Login"></TD>
                  <TD ALIGN = "CENTER" COLSPAN = "2">
            </TR>
      </TD>
      </CENTER>
</FORM>
            <TR>            
            <TD COLSPAN = "3" ALIGN = "CENTER">
            <FORM ACTION = "Form.Asp" METHOD="POST" NAME="NewUser">
                  <INPUT TYPE="HIDDEN" NAME="Type" VALUE="NewUser">
                  <INPUT TYPE="SUBMIT"  NAME="SubmitType" VALUE = "New User">
            </FORM>


            </TABLE>
      
</TABLE>
</CENTER>
</HTML>

-------------------------------------------------
This is the Verification Script:

<% Response.Buffer = TRUE %>
<%
Param = Request.QueryString("Param")
Data = Request.QueryString("Data")
%>
<%
If IsObject(Session("YourDSN_conn")) Then
    Set conn = Session("YourDSN_conn")
Else
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.open "YourDSN","",""
    Set Session("YourDSN_conn") = conn
End If
%>
<%
    sql = "SELECT Table.EMail, Table.UserPassword FROM Table;"

    If cstr(Param) <> "" And cstr(Data) <> "" Then
        sql = sql & " WHERE [Table.EMail] = request.form(LoginUser) "
    End If
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sql, conn, 3, 3
%>

<%
On Error Resume Next
rs.MoveFirst
do while Not rs.eof
%>

<%
User=rs.Fields("EMail")
Pwd=rs.Fields("UserPassword")
User=UCase(User)
Pwd=UCase(Pwd)
%>

<% If UCase(Request.Form("LoginUser")) = User Then %>
      <% NSuccess = True %>
      <% rs.MoveLast %>
      <% If UCase(Request.Form("LoginPassword")) = Pwd Then %>
            HELLO!!!
            <%
            Response.Clear
            Response.Redirect "/Form.asp"  ' Form.Asp is the for they will go to if pwd/username are correct
            %>
      <% Else %>
            The login specifications you supplied were incorrect.  Please check them and try again.<BR>
            You provided the wrong: <B><FONT COLOR = "Red">Password</B></FONT><BR>
            <% DontShowHeader = True %>  ' Redirect them back to login page w/ error code.
            <!-- #include Virtual="/UserInfo/Index.Asp" -->
      <% End If %>
<% Else %>
      <% NSuccess = False %>
<% End If %>

<%
rs.MoveNext
loop
%>

<% If NSuccess = false then %>
      The login specifications you supplied were incorrect.  Please check them and try again.<BR>
      You provided the wrong: <B><FONT COLOR = "Red">EMail Address</B></FONT><BR>
      <% DontShowHeader = True %>
      <!-- #include Virtual="/UserInfo/Index.Asp" -->
<%End If %>
<% rs.Close %>
--------------------------------------------------
0
 

Author Comment

by:pmaderia
ID: 1836901
Yes. What I really want is for my website to be able to authenticate off of an access database. Also I have different forms that I would like to retrieve the information from and have that placed in the database. Ideally it would be entered as soon as they hit submit. Thanks alot for your response. I am a computer Instructor at Devry. I teach small system so programming has never been my strong point but now I am falling in love with it, yet at the same time I'm trying to get a KILLER website up to show to some potential investors in a business that I have some ownership in. It's a Travel Agency so if you need anything I'll do it at cost. Again thanks for the reply. I look forward to hearing from you soon.

Pat
0
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
LVL 10

Expert Comment

by:MasseyM
ID: 1836902
That would be no problem at all.. The above scripts allow you to authenticate off the access database... As for adding info to the DB, that is simple as well.. I could write those for you if you would like, or you can do it yourself..  Very simple.  Check out the book "ProfessionalActive Server Pages 2.0" from Wrox Press.   It tells you EXACTLY how to do everything you ever wanted to know about database connection within ASP.  
0
 

Author Comment

by:pmaderia
ID: 1836903
I would like to have you do that. What site are you the webmaster of? How much would it cost? I really want to learn myself as well. I'm going to go out and get that book tommorrow.

Thanks,

Pat
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1836904
I run a website at http://ldsmissions.net/crm/index.asp and a number of other intranet web sites... The above link is the first I have done in ASP and it is still in BETA testing... (There seem to be some browser incompatibility in my HTML, so I have to work that out), but everything is run via the ASP language and it is all database driven... It is a pretty neat thing to have it all dynamic... As for cost, I would rather just help you along the way... Let you code it and when you run into problems, I will try and assist you... But, if you would like it coded, you can email me at masseym@hotmail.com and tell me exactly what you are looking for and what information you need presented and we can see what we can come up with...

- Thanks for your time.

Matt
0
 

Author Comment

by:pmaderia
ID: 1836905
What page layout program do you use. Frontpage or something like that?
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question