--0-9879481-1027031043=:25186
Content-Type: text/plain; charset=us-ascii
Larry Woods wrote:Carl,
Good stuff. A little problem with the Javascript:
alert("Please enter your username");
form.txtUsername.focus();
}
else if (form.txtPassword.value == "");
{
alert("Please enter your password");
form.txtPassword.focus();
There is an extra ";" at the end of the "else if" statement.
Larry Woods
> -----Original Message-----
> From: Carl E. Olsen [mailto:carl-olsen@m...]
> Sent: Thursday, July 18, 2002 7:31 AM
> To: Access ASP
> Subject: [access_asp] RE: username and password for
> access database
>
>
> I use ASP and Javascript to create the login page, and
> ASP to prevent
> anyone from seeing the data entry pages unless they
> have logged in
> first.
>
> Here is the code for the Logon.htm page:
>
> > PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> > xml:lang="en" lang="en">
>
>
> function form1_onsubmit()
> {
> var form = document.form1;
> var returnValue = false;
> if (form.txtUsername.value == "")
> {
> alert("Please enter your username");
> form.txtUsername.focus();
> }
> else if (form.txtPassword.value == "");
> {
> alert("Please enter your password");
> form.txtPassword.focus();
> }
> else
> {
> returnValue = true;
> }
> return returnValue;
> }
>
>
>
>
> To access this web page please enter your username and
> password in the
> boxes below
>
> > name="form1"
> onsubmit="return form1_onsubmit()">
>
Username :
> [input] > size="20" />
>
Password :
> [input] > type="password" size="20"
> />
>
> [input] > value="Reset" />
> [input] > value="Log On" />
>
>
>
>
>
> Here is the code for the CheckLogOn.asp page:
>
>
> > if (Request.Form("txtUsername") == "Username" &
> Request.Form("txtPassword") == "Password")
> {
> Response.Cookies("IsValid") = "Yes";
> Response.Redirect("http://webpages.com/dataentrypage.asp");
> }
> else
> {
> Response.Redirect("http://webpages.com/Logon.htm")
> }
> %>
>
> Here is the code for the dataentrypage.asp page:
>
>
>
> > if (Request.Cookies("IsValid") != "Yes")
> {
> Response.Redirect("Logon.htm")
> }
> %>
>
> > -----Original Message-----
> > From: Ashley Gough [mailto:ashleygough@h...]
> > Sent: Thursday, July 18, 2002 5:23 AM
> > To: Access ASP
> > Subject: [access_asp] username and password for
> access database
> >
> > hi
> >
> > I want to have a username and password for an access database
> > I know access has a security option to enable a
> universal password to
> be
> > entered, but im looking for individual logins where
> work that person
> has
> > done on the database can be tracked using session
> variables or
> something.
> > I have looked at some books and Access help but they
> do not mention
> > anything
> > about making your own login page.
> > Does anyone know of any good resources or has anyone
> done this before
> that
> > could give me some advice
> >
> > Thankyou in advance
> >
> > Ashley Rose
> >
> >
> >
> >
> >
> _______________________________________________________
> __________
> > Join the world's largest e-mail service with MSN Hotmail.
> > http://www.hotmail.com
> >
> >
> to unsubscribe send a blank email to leave-access_asp-
> 1112135Q@p...
---------------------------------
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes