Wrox Programmer Forums
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO 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 May 25th, 2004, 01:23 PM
Registered User
 
Join Date: May 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Registrationconfirm.asp

Hello Everyone I am new to this site and I hope that I can find help.
I am using the Active Server Pages 3.0 book and I have to modify my registrationconfirm.asp page to store the registration information int eh database. The problem is the book doesn't give good examples and the download code is a little confusing. Here is my registrationconfirm.asp page:

<%@ Language=VBScript %>
<%
Option Explicit

Dim strFIRST, strLAST, strADDR1, strCITY, strSTATE, strZIP, strEMAIL, strPASSWORD

strFIRST = Request("FIRST_NM")
strLAST = Request.Form("LAST_NM")
strADDR1 = Request.Form("ADDR1")
strCITY = Request.Form("CITY_NM")
strSTATE = Request.Form("STATE_CD")
strZIP = Request.Form("ZIP_CD")
strEMAIL = Request.Form("EMAIL_ADDR")
strPASSWORD = Request.Form("PASSWORD")

%>


<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>

<title>Here is your e-mail confirmation</title><head>
<body>
<H3>Registration Complete</H3>
<%

  rem ------------------------------------
  rem - Instantiate the SMTP mailer object
  rem ------------------------------------
dim Mailer

 Set Mailer = Server.CreateObject("SMTPsvg.Mailer")

  rem ------------------------------------
  rem - Set the FromName and FromAddress
  rem - WARNING: These are REQUIRED FIELDS
  rem ------------------------------------
  Mailer.FromName = "JavaScripts R Us"
  Mailer.FromAddress = "[email protected]"

  rem ------------------------------------
  rem - Set the Remote Host (SMTP) Host
  rem - that we'll send this mail thru
  rem ------------------------------------
  Mailer.RemoteHost = "mail.davenport.edu"

  rem ------------------------------------
  rem - Set the recipient's address
  rem - that this message will go to
  rem - < To Name, email address
  rem ------------------------------------
  Mailer.AddRecipient "Donna A","[email protected]"

  rem ------------------------------------
  rem - Set the subject line
  rem ------------------------------------
  Mailer.Subject = "JavaScripts R Us Registration!"

  rem ------------------------------------
  rem - Set the message body text
  rem -
  rem - To optionally clear the text once
  rem - you have set it use the ClearBodyText
  rem - method (e.g. Mailer.ClearBodyText
  rem
  rem vbCrLf is a CR & LF combination (Carrage return/Line Feed)
  rem
  rem ------------------------------------
dim strBody
  strBody = "Thank you for registering with JavaScripts R Us.!" & vbCrLf & VbCrLf
  strBody = strBody & "We look forward to providing you with high quality scripts to enhance your websites!"

  strBody = strBody & "Your user id for logging into this site is " & Request.Form("EMAIL_ADDR") & VbCrLf

  strBody = strBody & "Your password is " & Request.Form("password") & VbCrLf
  strBody = strBody & "You registered with the following information:"
  strBody = strBody & Request.Form("FIRST_NM") & VbCrLf
  strBody = strBody & Request.Form("LAST_NM") & VbCrLf
  strBody = strBody & Request.Form("ADDR1") & VbCrLf
  strBody = strBody & Request.Form("CITY_NM") & VbCrLf
  strBody = strBody & Request.Form("ZIP_CD") & VbCrLf
  strBody = strBody & Request.Form("EMAIL_ADDR") & VbCrLf
  strBody = strBody & Request.Form("PASSWORD")



  strBody = strBody & "You registered from IP address: "

  strBody = strBody & "We look forward to having you as our customer!!!" & Now

  rem
  rem ClearBodyText erases the body just in case there is something in there...
  rem
  Mailer.ClearBodyText

  rem
  rem This assigns the string strBody to the BodyText property of the Mailer Object
  rem
  Mailer.BodyText = strBody

  rem ------------------------------------
  rem - Send the message
  rem ------------------------------------
  rem SendMail returns a true or false
  rem

  if Mailer.SendMail = True then
    Response.Write "Mail sent..."
  else
    Response.Write "Mail failure. Check mail host server name and tcp/ip connection...<br>"
    Response.Write Mailer.Response
  end if

  rem ------------------------------------
  rem - Destroy the Email Object
  rem ------------------------------------

  Set Mailer = Nothing

%>
<H1>Thank You! <BR>
<BR>
Customer Registration Confirmation<BR>
</H1>
Thank you <TR><TD><% = Request.Form("FIRST_NM")%> for registering with us. You will receive an e-email at <% = Request.Form("EMAIL_ADDR")%></TR></TD>
confirming your registration shortly.

<BR>Have a nice day.


<P><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1 ></P>
    <TR>
        <TD>First Name:</TD>
        <TD style='font-weight:bold;'><% = Request.Form("FIRST_NM")%></TD>

    </TR>
    <TR>
        <TD>Last Name:</TD>
        <TD style='font-weight:bold;'><% = Request.Form("LAST_NM")%></TD>
    </TR>
    <TR>
        <TD>Address:</TD>
        <TD style='font-weight:bold;'><% = Request.Form("ADDR1")%></TD>
    </TR>
    <TR>
        <TD>City:</TD>
        <TD style='font-weight:bold;'><% = Request.Form("CITY_NM")%></TD>
    </TR>
    <TR>
        <TD>State:</TD>
        <TD style='font-weight:bold;'><% = Request.Form("STATE_CD")%></TD>
    </TR>
    <TR>
        <TD>Zip Code:</TD>
        <TD style='font-weight:bold;'><% = Request.Form("ZIP_CD")%></TD>
    </TR>
    <TR>
        <TD>E-Mail:</TD>
        <TD style='font-weight:bold;'><% = Request.Form("EMAIL_ADDR")%></TD>
    </TR>
<TR>
        <TD>password:</TD>
        <TD style='font-weight:bold;'><% = Request.Form("password")%></TD>
    </TR>
<TR>
        <TD>password confirm:</TD>
        <TD style='font-weight:bold;'><% = Request.Form("password_confirm")%></TD>
    </TR>
<TR><TD>
<UL TYPE="square">
<CENTER> <A HREF="register.asp">Registration Page</A> </TR></TD>

</UL>
</TABLE>
</BODY>
</HTML>

NOW HERE ARE THE EXAMPLES THAT I NEED TO INCLUDE IN MY REGISTRATIONCONFIRM.ASP PAGE:

<%@ Language=VBScript %>




<HTML>
<HEAD>
<TITLE>Customer Add Sample</TITLE>
</HEAD>
<BODY>

</BODY>
</HTML>
<%

'
' Declare an object variable
'
Dim objCustomer

'
' Declare variables
'
Dim cust_id, _
first_name, _
last_name, _
address, _
city_nm, _
state_cd, _
zip_cd, _
email_addr, _
phone_no, _
password, _
Error

'
' Give the variables a value
' One would normally retrieve the
' values from the Request.Form collection
'
cust_id = 0
first_name = "Bob"
last_name = "Jones"
address = "415 Fulton"
city_nm = "Grand Rapids"
state_cd = "MI"
zip_cd = "49505"
email_addr = "[email protected]"
phone_no = "800-555-1212"
password = "password"

'
' Create an instance of Customer
' Customer is defined inside the include file
'
Set objCustomer = New Customer
Dim intRC, strPwd

'
' Call the add method of the customer object to
' add the customer to the database.
' cust_id will contain the customer ID if intRC is 1
' If intRC is zero, then there was an error
'
    intRC = objCustomer.Add(cust_id, _
                first_name, _
                last_name, _
               address, _
               city_nm, _
               state_cd, _
               zip_cd, _
               email_addr, _
               phone_no, _
               password, _
               Error )


'
' Destroy the customer object once we are done with it.
'


If( intRC = 1 ) Then
    Response.Write( "The newly registered customer ID is: " & cust_id & "<br />" )

    '
    ' Get the password
    '
    strPwd = objCustomer.getPassword(email_addr, Error)

    Response.Write(" <br />The customer's password is: " & strPwd)

Else
    Response.Write( "Oops! There was an error: " & Error )
End If

Set objCustomer = Nothing
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft FrontPage 5.0">
</HEAD>
<BODY>

<title>Here is your e-mail confirmation</title><head>
<body>
<H3>Registration Complete</H3>
<%

AND

<%@ Language=VBScript %>
<%

Dim objRS

Set objRS = Server.CreateObject("ADODB.Recordset")

objRS.Open "SELECT * FROM Customer", Application("cnCISP310_DUO")

%>
<HTML>
<HEAD>

<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>


<%

If( Not objRS.EOF ) Then

    Response.Write("<TABLE BORDER=1>")
    Response.Write("<TR><TD>ID</TD><TD>Name</TD><TD>E-MAIL</TD><TD>Password</TD><TD>Action</TD></TR>")

    While not objRS.EOF %>

        <TR>
            <TD><% = objRS("cust_id").Value%></TD>
            <TD><% = Trim(objRS("last_name").Value) & ", " & Trim(objRS("first_name").Value) %></TD>
            <TD><% = objRS("email_addr").Value%></TD>
            <TD><% = objRS("password").Value%></TD>
            <TD><A href="deleteCustomer.asp?cust_id=<% = objRS("cust_id").Value%>"><% = "Delete!" %></A></TD>
        </TR>

<%
        objRS.MoveNext
    Wend

    Response.Write("</TABLE>")

Else

    Response.Write("There are no customers to display!")
End If

%>


</BODY>
</HTML>
<%
objRS.Close
Set objRS = Nothing
%>

%>

PLEASE HELP ME TO MODIFY MY REGISTRATIONCONFIRM.ASP PAGE OR DIRECT ME SOMEWHERE FOR HELP

tHANKS










 
Old July 20th, 2004, 08:38 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 363
Thanks: 0
Thanked 1 Time in 1 Post
Default

hello,
  Are you getting any error? if so, wat error u r getting/


 
Old July 20th, 2004, 09:26 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi darmes,

What is the problem you are facing with this code, which you have never mentioned in your post and what kind of help you expect on this?

Cheers!

_________________________
- Vijay G
Strive for Perfection





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.