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

Submitting Redirected Forms

Status
Not open for further replies.

MartinDurant

Programmer
Jan 25, 2002
41
GB
I am integrating a card payment system into my web site and I need to use a 'jump page' to redirect requests to the card processor.

The reason for this is that the URL for the page that links to the card processor needs to be exactly specified (
Code:
[URL unfurl="true"]http://www.mydomain.co.uk/mylinkpage.asp[/URL]
) on the card processor's server to verify that the payment request comes from my site.

The page I want to link from has a variable passed to it so the url is always different ie. it has
Code:
...mylinkpage.asp?ordernum=12345
in it. This link page has a form containing data I need to send to the card processor.

What I need to do is send the form to another page on my site and then redirect it automtically to my card processor without the user having to do anything. I have been given a sample piece of javascript code to do this;
Code:
<body onload=&quot;document.forms[0].submit()&quot;>
but I don't know how to implement it. I don't speak Javascript yet, which doesn't help.

Any ideas?

Thanks

Martin.
 
why u make that so tedious
after submiting the url
...mylinkpage.asp?ordernum=12345

in the mylinkpage.asp write the belo code only
<%
ordernum=request.querystring(&quot;ordernum&quot;)
response.redirect(&quot;%>

thats all the page automatically redirect to ur nextlinkpage with the ordernumber as querystring
if u dont want to send that in querystring for sequrity purpose
please use session variables

happy programming
raghu
 
I don't want to send the ordernumber. I need to send the data (some of which is encripted) from the form in my first asp page to the link page, then send it off to my card processor as if the form was contained in the link page.

Thanks.
 
Martin, I'd recommend having your script &quot;re-write&quot; the from elements into a new form on your links page, then have a JavaScript onLoad event auto-submit the &quot;form&quot;. Here's a sample:
===========================================================

<%@ language=VBScript %>
<% Response.Expires = 0 'Keeps the page from being cached%>
<html>
<script language=&quot;JavaScript&quot;>

function bob() {


document.form1.submit();


}

</script>
<body onLoad=&quot;bob();&quot;>

<form name=form1 method=post action=carprocessing.asp>
<%

username = Request.Form(&quot;username&quot;)
address = Request.Form(&quot;address&quot;)
creditcardcompany = Request.Form(&quot;creditcardcompany&quot;)
ccnumber = Request.Form(&quot;ccnumber&quot;)
ccexpmonth = Request.Form(&quot;ccexpmonth&quot;)
ccexpyear = Request.Form(&quot;ccexpyear&quot;)

response.write(&quot;<input type=hidden name=username value=&quot;+chr(34)+username+chr(34)+&quot;>&quot;)
response.write(&quot;input type=hidden name=address value=&quot;+chr(34)+address+&quot;>&quot;)
response.write(&quot;input type=hidden name=credicardcompany value=&quot;+chr(34)+creditcardcompany+&quot;>&quot;)
response.write(&quot;input type=hidden name=ccnumber value=&quot;+chr(34)+ccnumber+&quot;>&quot;)
response.write(&quot;input type=hidden name=ccexpmonth value=&quot;+chr(34)+ccexpmonth+&quot;>&quot;)
response.write(&quot;input type=hidden name=ccexpyear value=&quot;+chr(34)+ccexpyear+&quot;>&quot;)

%>
If you are seeing this text, then you need to have JavaScript enabled on this browser to continue.<br><br>Please enable your browser's JavaScript, then hit the Refresh or Reload button. Thank You.
</body>
</html>
===========================================================

This would solve your problem I think IF:
A- Folks have JavaScript turned on, &
B- All your purchase forms have the same information

If they have JS disabled, then they get the little text blurb saying to turn it on. If your forms are different, then you may need to either create a seperate routing page for each source form, or create a script that reads in the form elements, element types, and creates a hidden form accordingly (which is a little too complex to give an example of this early in the morning for this old man ;)

Hope this helps
AT
 
Top banana! That's just the ticket. Looks like I'll have to learn JavaScript now. It could be quite useful.

Thanks again.

Martin.
 
JavaScript, ASP, and HTML is the Trinity in MY programming book! JavaScript with/thru asp? Best of both worlds (client & server)

Enjoy!
 
I want to dynamically change the select statement in the form as user picks a value in the first field he has to get a set of values in the drop down of the next field
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top