Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 split form action...?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 10 January 2005 :  11:55:02  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
I have this form that has several steps... After all of the information is built up, I send the form post information to an external website.

However, I'd like to also store this information locally in a database or something, is there a way I can send the form information to two seperate locations seamlessly?

-Stim

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 10 January 2005 :  12:28:44  Show Profile
Quickest & dirtiest way would probably be to submit the form to a page on your server, grab the details you want off it, rebuild the form and resubmit it to the other site.

Another solution could be to do the same but use XML to send the form data to the other site instead of resubmitting the form. Unfortunately my knowledge of XML is far too limited to even begin to guess at how you'd go about doing this but, hopefully, I've pointed you in the right direction.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 10 January 2005 :  21:21:01  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
quote:
Quickest & dirtiest way would probably be to submit the form to a page on your server, grab the details you want off it, rebuild the form and resubmit it to the other site.


I decided to go with option a... but after loading everything and inserting into the database, how would I go about re-submitting the information? have the user click on another button? or is there a way I can auto-submit...?

The code I have so far is below - its for a client site's ordering form for paypal...


'### to show form's submitting properly, to be removed
For i=1 to request.form.count
  response.write(request.form.key(i) & " = " & request.form.item(i) & "<br />")
Next

  paypal_business = request.form("business")
  paypal_item_name = request.form("item_name")
  paypal_item_number = request.form("item_number")
  paypal_amount = request.form("amount")
  paypal_no_note = request.form("no_note")
  paypal_currency_code = request.form("currency_code")
  paypal_email = request.form("email")
  paypal_first_name = request.form("first_name")
  paypal_last_name = request.form("last_name")
  paypal_address1 = request.form("address1")
  paypal_address2 = request.form("address2")
  paypal_city = request.form("city")
  paypal_state = request.form("state")
  paypal_zip = request.form("zip")
  paypal_day_phone_a = request.form("day_phone_a")
  paypal_day_phone_b = request.form("day_phone_b")
  paypal_day_phone_c = request.form("day_phone_c")
  
  db_itemid   = paypal_item_number
  db_name     = paypal_first_name & " " & paypal_last_name
  db_address  = paypal_address1 & vbCrLf & paypal_address2 & vbCrLf & paypal_city & ", " & paypal_state & " " & paypal_zip
  db_phone    = paypal_day_phone_a & "-" & paypal_day_phone_b & "-" & paypal_day_phone_c
  db_date     = now()
  db_comments = request.form("comments")
  db_email    = paypal_email
  
  '#### whole bunch of error checking - removed for less post space
  
  '#### message to fake out user to backend work
  response.write("<center>Checking information...</center>")

  db_itemid   = Cint(db_itemid)
  db_name     = IntoDb(db_name)
  db_address  = IntoDb(db_address)
  db_phone    = db_phone
  db_date     = db_date
  db_comments = IntoDb(db_comments)
  db_email    = IntoDb(db_email)
  
  strsql = "INSERT INTO BUY_ITEM (BUY_NAME, BUY_ADDRESS, BUY_PHONE, BUY_ITEM_ID, BUY_DATE, BUY_COMMENTS, BUY_EMAIL) VALUES(" & _
  "'" & db_name & "', " & _
  "'" & db_address & "', " & _
  "'" & db_phone & "', " & _
  db_itemid & ", " & _
  "'" & db_date & "', " & _
  "'" & db_comments & "', " & _
  "'" & db_email & "'" & _
  ")"
  
  response.write(strsql)

  '### here I rebuild the form with appropriate variables - removed for less post space

  response.write("submit button or somehow auto-submit here")

-Stim

Edited by - Da_Stimulator on 10 January 2005 21:23:28
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 11 January 2005 :  02:27:18  Show Profile  Visit Gremlin's Homepage
Just use XMLHTTP and post the data to the URL

http://www.4guysfromrolla.com/webtech/110100-1.2.shtml

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 11 January 2005 :  02:32:10  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Perfect, I'll test it out. Thanks Gremlin...

I dont know how I'm going to work this in yet, because the end user eventually has to end up on the paypal page that the form submits to...

-Stim

Edited by - Da_Stimulator on 11 January 2005 02:35:08
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 11 January 2005 :  02:52:18  Show Profile  Visit Gremlin's Homepage
If the destination URL accepts Querystrings then you may be able to use Response.Redirect instead.

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 11 January 2005 :  04:06:55  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Well... I'm learning this XMLHTTP object pretty quick, wish I had got to this earlier.... thx for that link again Gremlin. I think that will do the trick nicely with Paypals integrated integration resources

-Stim
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 11 January 2005 :  05:55:32  Show Profile
If the final destination for the form is Paypal, maybe you should do it the other way round - submit the form to Paypal first and then use their IPN to return details to a script on your site which you can use to pouplate your database. Of course, that all depends on what information exactly you need for your records.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 11 January 2005 :  12:10:30  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
quote:
Originally posted by Shaggy

If the final destination for the form is Paypal, maybe you should do it the other way round - submit the form to Paypal first and then use their IPN to return details to a script on your site which you can use to pouplate your database. Of course, that all depends on what information exactly you need for your records.





thats what I was going to do :) except igs going to have to wait now becays im blind in my right eye now....

-Stim

Edited by - Da_Stimulator on 11 January 2005 12:11:10
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07