register and redirect at the same time

databases United States
  • 19 years ago

    I am trying to send an email, at the same time that the user registers, that is, adds his/her record in the database. Is this possible?. Currently i have a confirm link that the user needs to click on, to send the email.
    When you first enter the page, the record is a new record so no userid can be retrieved, however when you click on the register button, i can see the record id (record_index).


    Thanks for any ideas.


    code:
    <head>
    <%
        Sub Write(strWriteThis)
           response.write(strWriteThis & "<br>")
         End Sub
    %>
    <%
             DIM userid
                     userid = request.querystring("userid")
             If (userid <> "") Then


           Dim myCDONTSMail
           Dim strFrom
           Dim strTo
           Dim strSubject
           Dim strMessage
                     


           
       
           strFrom = "natalia"
           strTo = request.querystring("email")
           strSubject = request.querystring("userid") & " " & "this is your registration ID."
           strBody = request.querystring("password") & " " & "this is your password, " & "and " & request.querystring("login") & " is your username."
           
           Set myCDONTSMail = CreateObject("CDONTS.NewMail")


           myCDONTSMail.Send strFrom,strTo,strSubject,strBody
           Set myCDONTSMail = Nothing
    End If%>
    </head>

  • 19 years ago

    yes!
    1) get rid of the HTML code... if you are going to redirect, don't bother with it.
    2) After you have sent the email, simply have a Response.Redirect("thefile.htm") statement.


    Simple :-)

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Java is to JavaScript what Car is to Carpet.” - Chris Heilmann