[web] asp jscript passing variables to another asp page

Started by
2 comments, last by soconne 17 years, 6 months ago
I have an online order form in html that posts all its form elements to another page called processorder.asp. In processorder.asp I gather all the information into variables and I need to then pass it to another page, but have the variables be posted to that other page as if they came from a form. How can I do this? So the setup is as follows: order.html ---> processorder.asp ---> transaction.asp In processorder.asp I get the values by using Request("var name"). But then I need to automatically redirecto to transaction.asp and make it think it was called from order.html so the variables I'm getting from Request("..") get put back in there, but with different names. Any help? ***EDIT***** Oh, and I cannot do this by simply passing the variables in the Response.Redirect string. The values must be hidden.
Author Freeworld3Dhttp://www.freeworld3d.org
Advertisement
Personally I'd try to do this without requiring another page. Are the pages on the same server? Can you not simply incorporate them into the same page by combining the source code (or if they have to be separate, create an include and put common functionality in there to reuse the code)?

If it's on another server, you could consider using a server-server POST by using some ActiveX object capable of doing this (Maybe MSXML HttpRequest? Or something from WinInet?)

Alternatively you could pass hidden fields back to the browser and have it do a POST to the other page with a form of hidden fields, but that would risk the user making unauthorised modifications - presumably you have done some validation on these values and want the values kept in their validated state.

Mark
Unfortunately I do not have a choice but to post the data to the 2nd page. I have the 1st page creating the hidden fields in a form but how do I force a page submit without the user pressing a button?
Author Freeworld3Dhttp://www.freeworld3d.org
Well I figured it out. I simply grabbed the form data from the 1st page, and in the 2nd page did Response.Writes to create another form with hidden fields and set the ACTION property to the 3rd page. Then in the onLoad event I forced the form to submit itself.
Author Freeworld3Dhttp://www.freeworld3d.org

This topic is closed to new replies.

Advertisement