Advertisement

06.27.2005 at 01:07PM PDT, ID: 21472449
[x]
Attachment Details

need to repost a form

Asked by seamusseamus in Active Server Pages (ASP)

Tags: , , ,

Hi there,  I have a form that users can fill out to view a demo.  When they fill out this form it puts their info in the DB and also checks to see if they have already asked for a demo.  This then sends out an email to me with their info so that I know that the got to the demo page.  What I need to do now is to repost that same information to another IP address.  Can anyone help with this?

here is the current code

<%
If Trim(Request("cmdAction")) = "email" Then
      
      Dim frm_firstname:      frm_firstname = Trim(Request("frm_firstname"))
      Dim frm_lastname:      frm_lastname = Trim(Request("frm_lastname"))
      Dim frm_title:             frm_title = Trim(Request("frm_title"))
      Dim frm_company:      frm_company = Trim(Request("frm_company"))
      Dim frm_email:            frm_email = Trim(Request("frm_email"))
      Dim frm_telephone:      frm_telephone = Trim(Request("frm_telephone"))
      Dim frm_besttimetocall:      frm_besttimetocall = Trim(Request("frm_besttimetocall"))
      
      'Saving the User to the database
      Set rs=server.createobject("ADODB.Recordset")
      strSQL = "SELECT Email, User_ID FROM Users WHERE Email = '" & frm_email & "'"
      rs.open strSQL, cnn, 0
            
      'The user doesn't exist yet.
      IF Rs.EOF Then
            Rs.close
            Rs.open "Users", cnn, adOpenKeyset, adLockPessimistic, adCmdTable
            Rs.AddNew
            Rs("First_Name") = parseSQL(frm_firstname)
            Rs("Last_Name") = parseSQL(frm_lastname)
            Rs("Company") = parseSQL(frm_company)
            Rs("Referred") = ""
            Rs("Phone") = parseSQL(frm_telephone)
            Rs("Email") = parseSQL(frm_email)
            Rs("Country") = ""
            Rs("Organizational_Area") = ""
            Rs("Knowledge_Type") = ""
            Rs("Knowledge_Product") = ""
            Rs("Improve") = ""
            Rs("Modified_Date") = Now()
            Rs.Update
            Rs.Close

            strSql = "SELECT User_ID FROM Users WHERE Email = '" & frm_email & "'"
            Rs.open strSQL, cnn, 0
            User_ID = rs("User_ID")
            Rs.close

            Session("Login") = True
            Rs.open "User_Login", cnn , adOpenKeyset, adLockPessimistic, adCmdTable
            Rs.AddNew
            rs("User_ID") = User_Id
            Rs("Modified_Date") = Now()
            Rs("Browser") = request.ServerVariables("HTTP_USER_AGENT")
            Rs.Update
            Rs.Close
            set Rs = Nothing
            
            Dim strBody
            
            strBody = ""
            strBody = "Demo site at " & Now() & VbCrLf & VbCrLf
            strBody = strBody & "Name: " & frm_firstname & " " & frm_lastname & vbCrlf & VbCrLf
            strBody = strBody & "Title: " & frm_title & vbCrlf & VbCrLf
            strBody = strBody & "Company: " & frm_company & vbCrlf & VbCrLf
            strBody = strBody & "Phone number: " & frm_telephone & vbCrlf & VbCrLf
            strBody = strBody & "Email address: " & frm_email & vbCrlf & vbCrlf & VbCrLf
            strBody = strBody & "Best time to call " & frm_besttimetocall & vbCrlf & VbCrLf
            
            Dim objMail
            Set objMail = Server.CreateObject("Persits.MailSender")
            
            objMail.Host = "mail.demo.com"
            objMail.Port = 25 ' Optional. Port is 25 by default
            
            objMail.From = "demo@demo.com"
            objMail.FromName = "Demo Web Site" ' Optional
            
            objMail.AddAddress "demo1@demo.com"
            'objMail.AddAddress "demo@demo.com"
            objMail.Subject = "Demo Web Site"
            objMail.Body =       strbody
            
            'On Error Resume Next
            objMail.Send
            'Response.Write Err.number & "=" & Err.Description
            
            IF Err <> 0 THEN
                Response.Write "<font color='red' size='+2'>There was an error sending your request: " & Err.Description & "</font>"
                  Err.Clear
                  Response.End
            End If
            Set objMail = Nothing
            msg = "Thank you for registering for the demo.  If you do not see the demo open " & _
                  " on your screen then you may have a pop-up blocker that is preventing it from " & _
                      " displaying.<P>Please <a href='Demo_main.swf'>click here</a> to launch the demo in your browser window."

%>
      <SCRIPT language="javascript">
            OpenWindow()
      </SCRIPT>
<%            
      Else
            Session("Login") = false
            msg = "You have already registered to view the demo. Please <a href='login.asp'>Click Here</a> to login and view the demo."
      End If
End IF
%>Start Free Trial
 
Loading Advertisement...
 
[+][-]06.27.2005 at 01:32PM PDT, ID: 14312700

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 03:13PM PDT, ID: 14313421

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.27.2005 at 11:20PM PDT, ID: 14315423

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.28.2005 at 06:35AM PDT, ID: 14318037

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.28.2005 at 06:38AM PDT, ID: 14318065

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.28.2005 at 06:39AM PDT, ID: 14318074

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: javascript, form, parsesql, repost
Sign Up Now!
Solution Provided By: joeposter649
Participating Experts: 4
Solution Grade: A
 
 
[+][-]07.05.2005 at 07:35PM PDT, ID: 14374425

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.27.2005 at 05:34PM PST, ID: 15559934

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]01.04.2006 at 01:25PM PST, ID: 15611879

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]01.09.2006 at 03:33AM PST, ID: 15647940

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32