Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

1 form ... 2 databases 1

Status
Not open for further replies.

orlandoj

Programmer
Feb 10, 2003
27
US
Hello,
I think I have a rather basic question, but can't figure out how to do this. I have one simple HTML form with a couple fields and a submit button. I need the form data to be submitted to 2 different databases on seperate servers.
I am using ASP and MS Access databases on both servers.
Thanks in advance!!
Jamie
 
Set the form action to a separate ASP form with no visible portion. Put your 2 separate SQL statements on that form. Include appropriate error checking. Execute the 2 statements then use a Response.Redirect to get back to your visible form.

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Sorry I don't think I was specific enough in the initial question. ONE of the databases is on our company's server, which I admin.

THE OTHER server, I don't have access to. I don't even know the path of the database. ..and I can't ask to find out.

Right now I just have the HTML form linked to the other company's .asp file. But I want to link it to my own .asp file, "intercept" all the data into my database, and then have it submit to the other company's database.

Is there a way to do this?

 
Sorry I'm having a problem understanding exactly what you're trying to achieve. Maybe if you post the links to the pages involved and show where your code is at the moment we can progress this

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
No problem! Thanks for your help. :)

Lets say there is server1.com and server2.com

I administer and have full control over server1.com
I have ZERO control on server2.com ... they are a business partner.

There is a simple HTML form on server1.com, which CURRENTLY sends its form data to server2.com/database.asp

I still need this form to submit the same data to server2.com/database.asp , but I now want to INTERCEPT this data and send it to server1.com/database.asp AND also send it to server2.com/database.asp

The new HTML form will have to send the form data to server1.com/database.asp , but I need server1.com/database.asp, in addition to writing to my database, send all the form data to server2.com/database.asp

Am I making sense? Thank you!
 

orlandoj said:
THE OTHER server, I don't have access to. I don't even know the path of the database. ..and I can't ask to find out.

You had us worried with that one.... ;-)

But.. it sounds like you want to proxy the form submission, which previously posted to another server's web page, and post the data to your own database before forwarding on the request to the same target page.

If the form post's using GET (rather than POST) as the method, then it is pretty easy, simply post to your own asp form, add the data to the db and then do a response.redirect to the other servers web page passing the Raw url.

Unfortunately, it is unlikely that it is using GET (if it is then just use the above method). In which case, you need to use the server version of XMLHTTPRequest (you would have used the client version of this if you've done anything with AJAX) to post data to the target web page after you have done your database work - then return the page's response to the user. This will seem as though it never left your site, as the URL will still show the page that does this processing in the background.



A smile is worth a thousand kind words. So smile, it's easy! :)
 
Thank you! Yes, I'm not doing anything illegal :) It's just a weird scenario that I have. I'll try this later tonight and let ya know if I have any questions.

Thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top