Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 30th, 2004, 01:21 AM
Authorized User
 
Join Date: Apr 2004
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP How to ?

Does any one help me How to create a login form
and have a check box Remember me . When user checked it then when
user come back user must dont login again . I know it use Coookies
but I don't know how to write code

thanks !

 
Old November 30th, 2004, 06:43 AM
Authorized User
 
Join Date: Nov 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

YOUR HTML PAGE....COPY AND PASTE THE CODE IN YOUR HTML PAGE...
<HTML>
<HEAD>
<TITLE>Cookie Test - Login</TITLE>
</HEAD>
<BODY>

Please enter your e-mail address and password to login to the system.
<FORM ACTION = "CheckLogin.asp" METHOD="POST" >
E-Mail Address: <INPUT TYPE = "Text" NAME = "Email" SIZE = "40"><BR>
Password: <INPUT TYPE = "Password" NAME = "Password" SIZE = "10"><P>
<INPUT TYPE = "Checkbox" NAME = "SaveLogin"> Save Login as a Cookie?<P>
<INPUT TYPE = "Submit" VALUE = "Login"> &nbsp; &nbsp;
<INPUT TYPE = "RESET">
</FORM>

</BODY>
</HTML>



__________________________________________________ ___

COPY THE CODE BELOW AND PASTE IT IN YOUR ASP PAGE..DO CHECK THE FORM ACTION IN THE ABOVE CODE...WRITE THE NAME OF THE ASP PAGE IN THE ACTION OF THE FORM IN WHCIH ASP PAGE YOU WILL BE PASTING THE BELOW CODE..




<%
  Dim bLoginSaved
  If Request.Form("SaveLogin") = "on" Then
    Response.Cookies("SavedLogin")("EMail") = Request.Form("email")
    Response.Cookies("SavedLogin")("pw") = Request.Form("password")
    Response.Cookies("SavedLogin").Expires = Date + 30
    bLoginSaved = True
  Else
    bLoginSaved = False
  End If
%>
<HTML>
<HEAD>
<TITLE>Cookie Test - Check Login</TITLE>
</HEAD>
<BODY>
<%
  If bLoginSaved Then
    Response.Write "Saving Login information to a cookie"
  End If
%>
Thank you for logging into the system.<P>
E-Mail address confirmation: <%= Request.Form("email")%>
</BODY>
</HTML>


__________________________________________________ __

THIS IS THE EXAMPLE FROM THE BOOK "Beginning Active Server Pages 3.0"
by David Buser, John Kauffman, Juan T. Llibre, Brian Francis, Dave Sussman, Chris Ullman, Jon Duckett

Farzan Q.
BS(TeleCommunication)
Iqra University.





Similar Threads
Thread Thread Starter Forum Replies Last Post
send parameters from asp page to an asp.net form hastikeyvan ASP.NET 1.0 and 1.1 Basics 2 March 29th, 2008 01:32 AM
using asp.net web user control in asp 3.0 App i_shahid Classic ASP Professional 0 January 8th, 2008 07:32 AM
Custom HTTP 404 Problem w/ASP to ASP.NET kwilliams ASP.NET 2.0 Professional 7 November 26th, 2007 04:17 PM
Upgrading ASP w/ SQLserver 2000 to ASP.NET w/2005 cJeffreywang ASP.NET 2.0 Basics 1 April 5th, 2007 11:30 PM
Porting a sa,ple ASP CR viewer app to ASP.NET jhansen42 Crystal Reports 0 August 29th, 2003 10:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.