Question

Locked

Problem with a logon, Logonvalidation, registerentry and register.asp pages

By 1962wha ·
I am using frontpage 2002 and access 2002, I have checked to see if database was connected and it is. When testing the pages in the browser it takes me to microsoft Development program showing me the code. How can I correct this.

Logon.asp Code:


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<form method="POST" action="Logonvalidation.asp" onSubmit="location.href='_derived/nortbots.htm';return false;" webbot-onSubmit>
<p><input type="text" name="Username" size="20">                
Username</p>
<p><input type="password" name="Password" size="20">                 
Password</p>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
<p> </p>
<p> </p>

</body>

</html>

Logonvalidation.asp

<%
'First we create a connection object
Set Conn = Server.CreateObject("ADODB.Connection")

'Next, we open the connection object by calling the connection string
'that FrontPage created and stored in the global.asa file when the "store"
'connection was created
Conn.Open Application("store_ConnectionString")

'Then we create a record set object and a SQL statement
Set RS = Conn.Execute ("SELECT * From Customers WHERE username = '" & Request.Form("username") & "' AND password = '" & Request.Form("password") & "'")

'Loop through the database to check for the users information
Do until RS.EOF
Pass = RS("Password")
Name = RS("username")
RS.MoveNext
loop

'Close the recordset and database connection
RS.Close
Conn.Close
<% IF Message = "" Then %>
<table width="60%">
<tr>
<td width="100%"><b><font face="Arial">You have been logged in as: <% Response.Write Session("username") %></font></b><p>
<b><font face="Arial">Please select a page to go to:</font></b></p>
<p>  > <a href="protected.asp">protected.asp </a></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
<% Else %>
<table width="60%">
<tr>
<td width="100%"><% Response.Write Message %></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
<% End IF %>

<%'If the password given is not in the database then we don't do anything.
'Otherwise, we create the session objects
IF pass = "" Then
Message = "The Password you entered is either wrong or not found in our database. Please press the BACK button and try again."
Else
Session("Password") = Pass
Session("username") = Name

'Now we will check to see it there is a session object for an original URL.
'This would have been created (as you will see later) if the user first tried
'to visit a protected page. If so, we send them there. If not, we stay here.
IF Session("Ori_URL") = "" Then 'do nothing
Else
Response.redirect(session("Ori_URL"))
End IF
End IF
%>


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

</body>

</html>

Register.asp


<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Username</title>
</head>

<body>

<form method="POST" action="registerentry.asp">
<p><input type="text" name="Username" size="20">                
Username</p>
<p><input type="text" name="Password" size="20">                
Password</p>
<p><input type="text" name="VerifyPassword" size="20">                
Verify Password</p>
<p> </p>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>

</body>

</html>

registerentry.asp


<html>

<head>
<%
Session("Username") = Request.Form("UserName")
Session("Password") = Request.Form("Password")
%>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<%
If Session("Ori_URL") = "logon.asp" Then
Else
Response.redirect(session("Ori_URL"))
End If
%>
<!--webbot bot="DatabaseRegionStart" s-columnnames="ID,Username,password" s-columntypes="3,202,202" s-dataconnection="Database1" b-tableformat="FALSE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="FALSE" b-listseparator="FALSE" i-listformat="5" b-makeform="TRUE" s-recordsource="Customer" s-displaycolumns="ID,Username,password" s-criteria s-order s-sql="SELECT * FROM Customer" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="BODY" preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00" align="left"><font color="#000000">This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.</font></td></tr></table>" startspan --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Customer"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="Database1"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&Username=202&password=202&"
fp_iDisplayCols=3
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="25457" --><table BORDER="1">
<tr>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Username,password" s-column="ID" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"<</font>ID<font size="-1">>/font>" startspan --><%=FP_FieldVal(fp_rs,"ID")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="62813" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Username,password" s-column="Username" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"<</font>Username<font size="-1">>/font>" startspan --><%=FP_FieldVal(fp_rs,"Username")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="17407" --></td>
<td>
<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,Username,password" s-column="password" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"<</font>password<font size="-1">>/font>" startspan --><%=FP_FieldVal(fp_rs,"password")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="17043" --></td>
</tr>
</table>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="BODY" preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00" align="left"><font color="#000000">This is the end of a Database Results region.</font></td></tr></table>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></body></html>

Can anyone help, why is all the pages not loading properly in the browser.

Thanks

Anthony

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Networks Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums