Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon ?? hlp pls

Status
Not open for further replies.

NikP

Programmer
Mar 1, 2001
18
GB
Hi can anyone tell me the best way to create a log on in a pop up box....which will check the UserName Password against an Access dB...thanks.

Nik
 
Say you have these fields
<FORM ACTION=&quot;login.asp&quot; METHOD=&quot;post&quot;>
<TABLE BORDER=0>
<TR>
<TD ALIGN=&quot;right&quot;>Login:</TD>
<TD><INPUT TYPE=&quot;text&quot; NAME=&quot;login&quot;></INPUT></TD>
</TR>
<TR>
<TD ALIGN=&quot;right&quot;>Password:</TD>
<TD><INPUT TYPE=&quot;password&quot; NAME=&quot;password&quot;></INPUT></TD>
</TR>
<TR>
<TD ALIGN=&quot;right&quot;></TD>
<TD><INPUT TYPE=&quot;submit&quot; VALUE=&quot;Login&quot;></INPUT>
<INPUT TYPE=&quot;reset&quot; VALUE=&quot;Reset&quot;></INPUT>
</TD>
</TR>
</TABLE>
</FORM>


Your code below:
<%
'**************************************************************************
' This type of script becomes more useful and managable when you are
' comparing these values to those stored in a database or some other source
' of user information instead of hard coding them into the actual code.
' Just be sure that if a data source error arises you don't inadvertantly
' end up giving access to the pages you are trying to protect!
'**************************************************************************

If Request.Form(&quot;login&quot;) = &quot;Guest&quot; AND Request.Form(&quot;password&quot;) = &quot;Guest&quot; Then
Response.Write &quot;This is all the <B>cool stuff</B> we are trying to protect!&quot;
Else
Response.Write &quot;Access Denied!&quot;
'*****************************************************************
' Note: we don't use the next line so that our description below
' the script comes in. If you wanted to just stop everything here
' you would un-comment the next line and it would stop execution.
'*****************************************************************
'Response.End
End If
%>


QUOTE OF THE DAY
The only ideas that will work for you are the ones you put to work.


<%
Jr Clown
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top