PDA

View Full Version : Auto-Execute Form & Redirect


smurfus
09-19-2005, 02:18 AM
Greetings...

First I want to say thanks to all those people who post thier knowledge here. I have answered many basic questions by searching these forums. Your efforts are not wasted.

Here is my problem.

I accept Paypal for payments. I advertise on many different sites and some do not allow scripts or other data processing routines to run. I would like to link to a page that contains the <form> code from paypal, executes it with the predefined and encrypted data, perhaps loads a webcounter for tracking traffic, and redirects to Paypal for processing. My hopes is that the user never sees anything but Paypal.

I found this snippet searching these forums:

<html>
<head>
<META HTTP-EQUIV="Refresh"
CONTENT="1; URL=http://www.wherever.com/index.htm">
<title>HTML Redirect</title>
</head>
</html>

Just not what I need, but really close.

Many thanks to anyone willing to lend some assitance.

GatorSr
09-19-2005, 03:08 AM
Welcome to the fourm

Lotsa help here once we understand precisely what you need. From what you provided so far, I'm not sure how the transaction occurs.

If you have a web site setup with a buy page for PayPal e-commerce, the ads you place on other sites could contain a link to your page without any script or data processing routine.

Otherwise, I'd like to know where this redirect page is going to be hosted to process their PayPal transaction.

Provide a few more details and I'll try to help unless someone gets here first.

Good luck

smurfus
09-19-2005, 09:00 AM
Here is the <form> code output by Paypal...

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7----- ENCRYPTED INFORMATION HERE.... END PKCS7-----">
</form>

Instead of going stright to Paypal when they click the button I'd like to route them through a page of my own first...

<A HREF="http://www.mydomain.com/PaypalForm.htm" TARGET="New" NAME="New"><img SRC="https://www.paypal.com/en_US/i/btn/x-click-butcc.gif" ALT="Make payments with PayPal - it's fast, free and secure!!"></A>

Only... I don't know how to get PaypalForm.htm to make it invisibly execute the form (and/or other processes) as if the user had clicked it directly. That a little clearer I hope? :thumbup:

smurfus
09-19-2005, 01:57 PM
Ok... I found this searching the web... I have tried using it in various ways with no positive results...

Can anyone see what I am getting at and point me in the right direction?

<head>
<script language="javascript">
<!--
document.myform.submit()
//-->
</script>
...other head section stuff (Title, Description,etc.)...
</head>
<body>
<form name="myform" action="pagename.html" method="get"></form>
...rest of the page...

_Aerospace_Eng_
09-19-2005, 02:26 PM
That isn't going to work because the form doesn't exist yet. Place it after the form and it should work.

RysChwith
09-19-2005, 04:20 PM
Or change it to:window.onload = document.myform.submit();which will give you the same effect.

Rys