www.webdeveloper.com
Results 1 to 4 of 4

Thread: This isn't a guest book...

  1. #1
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,222

    This isn't a guest book...

    <%@ LANGUAGE="VBSCRIPT" %>

    <!--- This example illustrates the use of a "thank you" note after submitting a form --->

    <HTML>
    <HEAD>
    <TITLE>ASP Guestbook Thank You</TITLE>
    </HEAD>

    <BODY>
    Thanks for filling out our survey, <%=Request.form("yourname")%>.

    <!-- The following area delineates and sends mail -->

    <P>
    <%

    ' Set up variables to hold the text strings
    Dim DestinationEmail
    Dim OriginatingEmail
    Dim Subject
    Dim Body


    ' assign text to the variable
    OriginatingEmail = Request.form("email")
    DestinationEmail = "you@email.com"
    Subject = "The Subject Line Goes Here"

    ' The body contains all the form data separated by semicolons
    Body = "Name = " & Request.form("yourname") & "; Email Address = " & Request.form("email") & "; Answer = " & Request.form("answer")

    ' Send email via the SendMail utility...note that this is an add-on to Active Server Pages and needs to be installed separatelly on the server.
    Set email = Server.CreateObject("MPS.SendMail")
    retCode = email.SendMail(OriginatingEmail, DestinationEmail, Subject, Body)

    ' Posts if mail has been sent or not
    IF NOT True = retCode THEN
    Response.write("Failed to send form results to "&DestinationEmail&" due to "&Err.Description&".<P>")
    ELSE
    Response.write("Your form Results have been sent.<P>")
    END IF

    ' Posts answer depending on radio button choice
    IF Request.form("answer") = "yes" THEN
    Response.write("I like Active Server Pages Too!")
    ELSE
    Response.write("I don't like Active Server Pages either!")
    END IF
    %>
    </BODY>
    </HTML>

    That looks more like an email form because it just submitsa the form via email. Stupid brinkster wont even let me do that with asp. Shouldn't a guest book add this code automatically to the thread or what is the deal with that. This is the thankyou page by the way. Oh and yea this asp.net is making me mad. I am getting a bunch of server errors and am using this debugger to figure out what the heck is wrong. This is tedious when you dont quite know what you are doing

  2. #2
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,222
    Does this just submit in email that someone signed the guest book and it actually posts or does it just sned the entry

  3. #3
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    yes you are correct its not a guest book. Alos the code is ASP not ASP.NET??????
    Hopes this helps answer your question
    ----------------------------------

  4. #4
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    to your other question this is only a thank you page for display and sending an automatic email to a user on submittion of a form.
    ----------------------------------

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles