onlyican Posted August 9, 2006 Share Posted August 9, 2006 HeyI have a formWhat I want is a form on submit goes to my page, easy<form method='post' action='mypage.php' target='_self'>I also want on Submit to go to paypal<form method='post action='www.paypal.com/full_link_here' target='_blank'>NOWI want One Form, One Submit but those 2 actions?How could I do this? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 9, 2006 Share Posted August 9, 2006 Well you can submit the form to mypage.php, then use cURL to sends the post'd data to paypal. Quote Link to comment Share on other sites More sharing options...
onlyican Posted August 9, 2006 Author Share Posted August 9, 2006 mm, how? Quote Link to comment Share on other sites More sharing options...
mewhocorrupts Posted August 9, 2006 Share Posted August 9, 2006 [quote author=onlyican link=topic=103569.msg412501#msg412501 date=1155136334]HeyI have a formWhat I want is a form on submit goes to my page, easy<form method='post' action='mypage.php' target='_self'>I also want on Submit to go to paypal<form method='post action='www.paypal.com/full_link_here' target='_blank'>NOWI want One Form, One Submit but those 2 actions?How could I do this?[/quote]After the form is submitted to "mypage.php," just place a header() command after the POST data is processed to redirect to the next site.[code]<?php.....header("Location: http://www.paypal.com/full_link_here?something={$_POST['arg1']}&somethingelse={$_POST['arg2']}");.....?>[/code]... or something like that. You could use cURL, too, but that'd be more for situations where you wanted to pull data remotely from the page your accessing and then include it in your own page. If that's what you're going for, then cURL is for you. But if you just want to redirect to a different page, while saving the POST data from your original form, header() would do just fine. Quote Link to comment Share on other sites More sharing options...
onlyican Posted August 9, 2006 Author Share Posted August 9, 2006 ok I can use GET method for paypalBut I need the 2 pages openAs the purpose is to confirm that the payment transaction is confirmedSo I can have the form like[code]<form method="post" action="pptest2.php"><input type="text" name="email" value="email@domain.tld" /><br /><input type="text" name="amount" value="4.99" /><br /><input type="submit" value="Pay" /></form>[/code]So how do I open a new page, without it being classed as a pop up Quote Link to comment Share on other sites More sharing options...
mewhocorrupts Posted August 9, 2006 Share Posted August 9, 2006 As far as I know, if a pop-up is generated by the user clicking a link, the browser will not treat it as a possible advertisement. You could also use an <iframe>, which I personally don't find visually appealing, but that's your perogative. I'm sure that there are other options, like possibly providing the confirmation via e-mail in a printable format rather than in the browser window. Quote Link to comment Share on other sites More sharing options...
Caesar Posted August 9, 2006 Share Posted August 9, 2006 What you're trying to do, sounds very user-unfriendly. Quote Link to comment Share on other sites More sharing options...
onlyican Posted August 10, 2006 Author Share Posted August 10, 2006 The reason is, this script I am doing goes to paypal Send Money, with the form completed.AND it goes to another page on my script to say Have you paidI added a pop up. It is only admin who will need to use this page Quote Link to comment Share on other sites More sharing options...
mewhocorrupts Posted August 10, 2006 Share Posted August 10, 2006 I'll have to check again, but I believe that PayPal provides an API if you want to develop your own shopping cart system, and have the confirmation generated on your page. I know that Google does. That'd be your best bet if you want to have a fully customized setup. Quote Link to comment Share on other sites More sharing options...
onlyican Posted August 10, 2006 Author Share Posted August 10, 2006 I have set up the system with shopping cart ectBut I am building an affiliation scriptSo I was building a script where the admin can pay the affiliatesThey way it is set up, the form in dyanmicly generated hidden. On click this will open paypals "Send Money" tab, with the email address and amount set upBut for security I cant pay and check payment, so the 2nd page is for the admin to click when the payment is confirmed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.