home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / login.asp < prev    next >
Text File  |  1997-11-01  |  11KB  |  334 lines

  1. <%@ LANGUAGE="VBSCRIPT" %>
  2. <% 
  3.   Option Explicit 
  4.  
  5.   Dim m_lngAccountID, m_intLoginRequest, m_strPassword, m_strMainPrompt, m_intPassChk
  6.  
  7.   m_intLoginRequest = Request.Form("ValidationReq")
  8.   
  9.   If m_intLoginRequest = 1 Then 'This is a request to authenticate and log on
  10.         ' now validate to make sure an integer was entered 
  11.         If Not IsWholeNum(Request.Form("AccountID")) Then
  12.             m_strMainPrompt = "You must enter a valid account number to log on. For example: <STRONG>12345</STRONG>"
  13.         Else
  14.         m_strPassword = Request.Form("Password")
  15.         'Check to see if the correct password was entered
  16.         CheckPassword
  17.         End If
  18.   Else 'not a login  request-- first time hitting the page
  19.     m_strMainPrompt = "Please enter your account number and password to log on."
  20.   End If
  21. %>
  22.  
  23. <%
  24.     ' Are we using SSL for this page?
  25.     Dim m_fUsingSSL
  26.     m_fUsingSSL = False
  27.     If UCase(Request.ServerVariables("HTTPS")) = "ON" Then m_fUsingSSL = True
  28. %>
  29.  
  30. <!--BEGIN HTML-->
  31. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
  32. <HTML>
  33. <HEAD>
  34. <!--META TAGS ARE RECOMMENDED FOR THE SEARCH ENGINE-->
  35. <META NAME="DESCRIPTION" CONTENT="Exploration Air's log-in page for members">
  36. <META NAME="KEYWORDS" CONTENT="join, log on, sign up, club, members, privileges">
  37. <META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev 1.0">
  38. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
  39. <!--END META TAGS-->
  40.  
  41. <TITLE>Exploration Air's Log On Page</TITLE>
  42. </HEAD>
  43.  
  44. <BODY BGCOLOR=#FFFFFF TOPMARGIN=0 LEFTMARGIN=0 ALINK=#23238E VLINK=#228B22 LINK=#23238E>
  45. <BASEFONT FACE="VERDANA, ARIAL, HELVETICA" SIZE=2>
  46.  
  47. <!--Change link color on mouseover
  48.     Only if running Internet Explorer 4.0 or later -->
  49. <!--#include file=../libHighlight.inc-->
  50. <!--#include file=../libGlobalFuncs.inc-->
  51.  
  52. <FONT <%= Application("Font2") %>>
  53.  
  54. <!--COLOR BANNER_START-->
  55. <CENTER>
  56. <TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
  57.     <TR>
  58.         <TD BGCOLOR="#C71585" WIDTH=100% HEIGHT=20></TD>
  59.     </TR>
  60. </TABLE>
  61. <!--COLOR BANNER_END-->
  62.  
  63. <!--BEGIN TABLE and SUB-TABLES WHICH CONTAIN NAVIGATIONAL SIDEBAR AND MAIN CONTENT-->
  64. <!--BEGIN NAVIGATIONAL SIDEBAR-->
  65. <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%>
  66.     <TR>
  67.         <TD WIDTH=100% COLSPAN=4 VALIGN=TOP HEIGHT=74>
  68.             <TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
  69.                 <TR>
  70.                     <TD WIDTH=430 HEIGHT=76>
  71.                         <TABLE WIDTH=430 HEIGHT=76 CELLSPACING=0 CELLPADDING=0 BORDER=0>
  72.                             <TR>
  73.                                 <TD HEIGHT=179 COLSPAN=5>
  74.                                     <IMG SRC="images/freqflyer.jpg" WIDTH=420 HEIGHT=240 ALT="Exploration Air Frequent Flyer logo" BORDER=0>
  75.                                 </TD>
  76.                             </TR>
  77.                             <TR>
  78.                                 <TD ALIGN=RIGHT VALIGN=TOP BGCOLOR="#FFFFFF" WIDTH=20 HEIGHT=31>
  79.                                     <A HREF="<%=HomePage("..")%>">
  80.                                     <IMG SRC="../images/barrowy.gif" HEIGHT=8 WIDTH=8 ALT="Return to Exploration Air's Home Page" VSPACE=6 BORDER=0></A>
  81.                                 </TD>
  82.                                 <TD VALIGN="TOP" BGCOLOR="#FFFFFF" WIDTH=300 HEIGHT=40>
  83.                                      <FONT <%= Application("Font2") %>>
  84.                                     <STRONG><A HREF="<%=HomePage("..")%>">EXPLORATION  AIR  HOME PAGE</A></STRONG></FONT>
  85.                                 </TD>
  86.                                 <TD WIDTH=2 BGCOLOR="#FFFFFF">
  87.                                 </TD>
  88.                                 <TD VALIGN=TOP BGCOLOR="#FFFFFF" WIDTH=200 HEIGHT=40>
  89.                                 </TD>
  90.                             </TR>
  91.                         </TABLE>
  92.                     </TD>
  93.                     <TD WIDTH=195 ALIGN="CENTER">
  94.                         <FONT <%= Application("Font5") %> COLOR="#0000FF">
  95.                             <%If m_fUsingSSL Then Response.Write("Secure ")%>Log On
  96.                         </FONT>
  97.                         <BR>
  98.                         <FONT <%= Application("Font2") %>>
  99.                         <CENTER><%= m_strMainPrompt %><P></CENTER>
  100.             
  101.                         <!--LOGIN FORM -->
  102.                         <CENTER>
  103.                         <TABLE>
  104.                             <FORM NAME="LoginForm" METHOD=POST ACTION="Login.asp" LANGUAGE="JavaScript" onSubmit="return validate();">
  105.                                 <INPUT TYPE=HIDDEN NAME="ValidationReq" Value=1>
  106.                                 <TR>
  107.                                   <TD BGCOLOR="#C71585" ALIGN=RIGHT WIDTH=130><FONT <%= Application("Font2") %> COLOR="#FFFFFF"><B>Account Number:</B></TD>
  108.                                   <TD  ALIGN=LEFT><INPUT SIZE=19 MAXLENGTH=20 NAME="AccountID" VALUE=<%= m_lngAccountID %>></TD>
  109.                                 </TR>
  110.                                 <TR>
  111.                                   <TD BGCOLOR="#C71585" ALIGN=RIGHT WIDTH=130><FONT <%= Application("Font2") %> COLOR="#FFFFFF"><B>Password:</B></TD>
  112.                                   <TD ALIGN=LEFT><INPUT TYPE=PASSWORD SIZE=19 MAXLENGTH=20 NAME="Password" VALUE=></TD>
  113.                                 </TR>
  114.                                 <TR>
  115.                                   <TD HEIGHT=10></TD>
  116.                                 </TR>
  117.                                 <TR>
  118.                                   <TD COLSPAN=4 ALIGN=CENTER><INPUT TYPE=SUBMIT VALUE="Log On"></TD>
  119.                                 </TR>
  120.                             </FORM>
  121.                         </TABLE>
  122.                         </CENTER>
  123.                         <!--END OF LOGIN FORM -->
  124.                         </FONT>
  125.                     </TD>
  126.                     <TD VALIGN=TOP ALIGN=RIGHT>
  127.                         <A HREF="../HowItWorks/HIWLogin.asp"><IMG SRC="../images/btssmall.gif" WIDTH="115" HEIGHT="52"  ALT="Click here to learn how this page works"  BORDER=0></A>
  128.                         <TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
  129.                             <TR>
  130.                                 <TD ROWSPAN=2 WIDTH=100% HEIGHT=76 BGCOLOR="#FFFFFF">
  131.                                 </TD>
  132.                             </TR>
  133.                         </TABLE>
  134.                     </TD>
  135.                 </TR>
  136.             </TABLE>    
  137.         </TD>
  138.     </TR>
  139. </TABLE>
  140.  
  141. <TABLE WIDTH=100% BORDER=0>
  142.     <TR>
  143.         <TD VALIGN=TOP BGCOLOR="#FFFFFF">
  144.  
  145.             <TABLE WIDTH=100% CELLPADDING=5 CELLSPACING=5 BORDER=0>
  146.                 <TR>
  147.                     <TD VALIGN="TOP">
  148.                         <A HREF="Profile.asp?UpdateUser=0">
  149.                         <IMG SRC="images/joinff.gif" WIDTH="117" HEIGHT="45" ALT="Click to join the Frequent Flyer Club" ALIGN="MIDDLE" BORDER=0>
  150.                         </A>
  151.                         <P>
  152.                         <%     
  153.                             ' If this is an SSL connection then place some text 
  154.                             ' on the screen to make the users feel comfortable!
  155.                             If m_fUsingSSL Then 
  156.                         %>
  157.                         <CENTER>
  158.                         <TABLE WIDTH=117 BORDER=0 CELLPADDING=9>
  159.                             <TR>
  160.                                 <TD BGCOLOR=#FFFFCC>
  161.                                     <FONT SIZE=2>
  162.                                     <IMG SRC="..\images\secure.gif" ALIGN=RIGHT>
  163.                                     The site operates in a secure environment while in the Frequent Flyer Club. 
  164.                                     This ensures the integrity of your name, password and any details you provide.
  165.                                     </FONT>
  166.                                 </TD>
  167.                             </TR>
  168.                         </TABLE>
  169.                         </CENTER>
  170.                         <% End If %>
  171.                     </TD>
  172.                     <TD>
  173.                       <TABLE BORDER=1 WIDTH=75% HEIGHT=80 ALIGN=CENTER CELLPADDING=4>
  174.                         <TR>
  175.                           <TD>
  176.                             <CENTER>
  177.                             <FONT SIZE=3 COLOR=RED><STRONG>Limited Time Offer!</STRONG></FONT>
  178.                             <FONT SIZE=3 COLOR=BLUE> <A HREF="Profile.asp?UpdateUser=0">Join today</A>
  179.                             and receive 50,000 free miles to get your travel started. You can book a
  180.                             free flight today just by joining!</FONT>
  181.                             <CENTER>
  182.                           </TD>
  183.                         </TR>
  184.                       </TABLE>
  185.                         <P>
  186.                         If you are not a member of the Exploration Air Frequent Flyer Club and would like to join,
  187.                         simply click the button on the left.
  188.  
  189.                         Once you log on to Exploration Air's Frequent Flyer application, 
  190.                         (and fill out a brief form if you're new to our online services) 
  191.                         it's very easy to explore the following benefits:
  192.                         <UL>
  193.                             <LI>Book a Free Flight
  194.                             <LI>View Your Account History
  195.                             <LI>Edit Your Profile
  196.                             <LI>Destination of the Week
  197.                         </UL>
  198.  
  199.                         Online customers also receive special vacation package deals available only on our Web site, 
  200.                         so be sure to check out Exploration Air's <STRONG>Destination of the Week</STRONG>!
  201.                         <P>
  202.                         We hope by now we've piqued your interest in the excellent benefits our Frequent Flyer Club members receive.   
  203.                         <A HREF="Profile.asp?UpdateUser=0">Registering</A> is simple, fast, and secure, and our logon program will 
  204.                         provide you with a confidential password.
  205.                         <P>
  206.                     </TD>
  207.                 </TR>
  208.             </TABLE>
  209.         </TD>
  210.     </TR>
  211. </TABLE>
  212.  
  213. <TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=0 BORDER=0>
  214.     <TR>
  215.         <TD>
  216.             <BR>
  217.             <BR>
  218.             <BR>
  219.  
  220.             <!--BEGIN NESTED TABLE WHICH HOLDS RIGHT-ALIGNED HORIZONTAL RULE DIVIDER-->
  221.             <CENTER>
  222.                 <TABLE WIDTH=90% CELLSPACING=0 CELLPADDING=0>
  223.                     <TR>
  224.                     <TD HEIGHT=3></TD>
  225.                     </TR>
  226.  
  227.                     <TR>
  228.                     <TD HEIGHT=1 BGCOLOR="#808080">
  229.                     <TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=0 BORDER=0 BGCOLOR="#808080"><TR><TD></TD></TR></TABLE></TD>
  230.                     </TR>
  231.                 </TABLE>
  232.             </CENTER>
  233.             <!--END NESTED TABLE WHICH HOLDS RIGHT-ALIGNED HORIZONTAL RULE DIVIDER-->
  234.  
  235.         </TD>
  236.     </TR>
  237.     <TR>
  238.         <TD HEIGHT=30>
  239.         </TD>
  240.     </TR>
  241.     <TR>
  242.         <TD>
  243.             <!--BEGIN LEGAL INFORMATION-->
  244.             <CENTER>
  245.             <FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="1"><A HREF="../legal.htm">©1997 Microsoft Corporation. All rights reserved. Terms of Use.</A></FONT></FONT>
  246.             </CENTER>
  247.         </TD>
  248.     </TR>
  249.     <TR>
  250.         <TD HEIGHT=30>
  251.         </TD>
  252.     </TR>
  253. </TABLE>
  254. <!--END LEGAL INFORMATION-->
  255. <!--END MAIN TABLE-->
  256.  
  257. <!--COLOR BANNER_START-->
  258. <TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
  259.     <TR>
  260.         <TD BGCOLOR="#C71585" WIDTH=100% HEIGHT=20></TD>
  261.     </TR>
  262. </TABLE>
  263.  
  264. <!--COLOR BANNER_END-->
  265. </BODY>
  266. </HTML>
  267. <!--END HTML-->
  268.  
  269. <SCRIPT LANGUAGE="JavaScript">
  270.   // This function checks that the form was filled out with valid data (i.e. an integer
  271.   // for the AccountID and a non-null string for the password)
  272.   function validate()
  273.   {
  274.     if (!isNum(document.LoginForm.AccountID.value)){
  275.       alert('Please provide a valid account number');
  276.       document.LoginForm.AccountID.select();
  277.       return false;
  278.     }
  279.     return true;
  280.   }
  281.  
  282.  
  283.   // This function is called by the validate function and checks if a string
  284.   // contains an integer
  285.   function isNum(str) {
  286.     for (var i = 0; i < str.length; i++) {
  287.       var ch = str.substring(i, i + 1);
  288.       if (ch < "0" || "9" < ch) {
  289.         return false;
  290.       }
  291.     }
  292.     return true;
  293.   }
  294.  
  295. </SCRIPT>
  296.  
  297. <% 
  298.   Sub CheckPassword
  299.     On Error Resume Next
  300.  
  301.     Dim Member, intPassResult
  302.     Set Member = Server.CreateObject("ExAir.Member")    
  303.     If Err.Number <> 0 Then
  304.       m_strMainPrompt = err.number & err.description & " An error occurred while trying to create an instance of the Member component. Please try to log in again later."
  305.       Exit Sub
  306.     End If
  307.  
  308.     intPassResult = Member.CheckPassword(Application("DSN"), m_lngAccountID, m_strPassword)
  309.     If Err.Number <> 0 Then
  310.       m_strMainPrompt = "An error occurred (" & Hex(Err.Number) & ") while checking the database (" & Application("DSN") & "). Please try to log in again later."
  311.       Exit Sub
  312.     End If
  313.  
  314.     If intPassResult = 1 Then
  315.       Session("AccountID") = m_lngAccountID
  316.       Response.Redirect("default.asp")
  317. '      Response.End
  318.     ElseIf intPassResult = 0 Then
  319.       m_strMainPrompt = "You did not provide the correct password for this account. Please check your account number and password and try again." 
  320.     End If
  321.  
  322.   End Sub
  323.  
  324.   Function IsWholeNum(input)
  325.     On Error Resume Next
  326.     m_lngAccountID = CLng(input)
  327.     If Err.Number <> 0 Then
  328.         IsWholeNum = False
  329.     Else
  330.         IsWholeNum = True
  331.     End If
  332.   End Function
  333. %>
  334.