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

Call 2 scripts from 1 FORM submit button

Status
Not open for further replies.

pdunk

Technical User
Feb 17, 2005
3
US
From a shopping cart script, I want the submit button to
call the cart.pl -in order to email me a copy of the order
and submit a form to paypal so that the customer
can pay for the order

if ($FORM{'add'} {
&add_item;
...
print "<FORM NAME=\"form1\" METHOD=POST ACTION=\"$script\">
print <"INPUT TYPE=SUBMIT VALUE=get_address>";
exit;
}

if ( $FORM{'get_address'} ) {
&get_billto
...
...
print "<FORM NAME=\"form2\" METHOD=POST ACTION=\"$script\">";
print "<INPUT TYPE=SUBMIT VALUE=verify_order>;
print "</FORM> </BODY></HTML>";
}

if ( $FORM{'verify_order'} ) {
...calcs the total, shows the customer a completed invoice

print "<FORM NAME=\"form1\" METHOD=POST ACTION=\"$ppal\">\n";
...builds the form to send to Paypal
print "</FORM>\n\n\n </TD></TR></TABLE></CENTER>\n";
print "</BODY></HTML>\n";

&email_ordercopy;
##I put email function here to be sure I get a copy of the order
exit;
}

If the customer doesn't proceed to Paypal, I get a copy of
an order that wasn't really placed.
I would like the submit button in the verify_order routine
to send me the email and submit the form to paypal

ANY IDEAS ??
 
There should be an PayPal example of how to use Perl, and you should just call a function. Otherwise you could create an LWP request to send the form to the PayPal service

--Paul

cigless ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top