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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Post to an external page 2

Status
Not open for further replies.

JontyMC

Programmer
Nov 26, 2001
1,276
GB
I have a form on my site. Users enter some details. When submitted I want to store the variables and then submit all the form variables (perhaps changing them) to a different webpage (external). How do I go about doing this? Indeed is it possible? The only way I can think of doing it at the moment would be to use webrequest and display the result of that, but that would cause a URL change.

Jon

"I don't regret this, but I both rue and lament it.
 
By "external", do you mean a different site not on your server? If so, you could use a httpWebRequest to post the relevant data.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Yes, that is what I mean. There was an error in my post:

"...webrequest and display the result of that, but that would NOT cause a URL change."

I would like for the user to just seem like his form had been submitted to the external (not on my server) website.

Jon

"I don't regret this, but I both rue and lament it.
 
So after they filled the details out, clicked submit (and behind the scenes the data had been posted to a different server) where would you like the user to be? On you site with a confirmation message, or on the external site with their relevant page?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
External site.

Submit

>

Change some variables/store in DB

>

Post (and redirect) to External submission page

Jon

"I don't regret this, but I both rue and lament it.
 
two parts to your post:
part 1:
store the variables

this part will be no big deal.

part 2:
and then submit all the form variables (perhaps changing them) to a different webpage

for this do as ca8msm says, u have a method called HttpWebRequest that will allow you to post data to a page as if the browser were submitting data to that page...

Known is handfull, Unknown is worldfull
 
part 1 I can do.

I know HttpWebRequest can post data to the page, but it only does it in code. How can I 'redirect' the browser with the form variables they have already submitted?

Jon

"I don't regret this, but I both rue and lament it.
 
the best way to do that is to output a form(after u have saved the data) with hidden fields(which will contain the values to be posted) and submit the form(action cannot be changed in .NET but u can use javascript to change a form's action) to the external site(this submit must be automatic therefore intitiated by javascript)...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top