Jump to content


Photo

Double Action Form?


  • Please log in to reply
9 replies to this topic

#1 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 09 August 2006 - 03:12 PM

Hey
I have a form
What 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'>


NOW
I want One Form, One Submit but those 2 actions?
How could I do this?

Tell me the problem, I will try tell you the solution

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 09 August 2006 - 03:31 PM

Well you can submit the form to mypage.php, then use cURL to sends the post'd data to paypal.

#3 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 09 August 2006 - 03:55 PM

mm, how?
Tell me the problem, I will try tell you the solution

#4 mewhocorrupts

mewhocorrupts
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts
  • LocationParker, CO

Posted 09 August 2006 - 04:17 PM

Hey
I have a form
What 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'>


NOW
I want One Form, One Submit but those 2 actions?
How could I do this?


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.

<?php
.....

header("Location: http://www.paypal.com/full_link_here?something={$_POST['arg1']}&somethingelse={$_POST['arg2']}");

.....
?>

... 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.
-mewhocorrupts

#5 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 09 August 2006 - 04:52 PM

ok I can use GET method for paypal

But I need the 2 pages open
As the purpose is to confirm that the payment transaction is confirmed

So I can have the form like
<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>

So how do I open a new page, without it being classed as a pop up
Tell me the problem, I will try tell you the solution

#6 mewhocorrupts

mewhocorrupts
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts
  • LocationParker, CO

Posted 09 August 2006 - 10:50 PM

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.
-mewhocorrupts

#7 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 09 August 2006 - 11:07 PM

What you're trying to do, sounds very user-unfriendly.
PHP Ninja

#8 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 10 August 2006 - 12:04 AM

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 paid

I added a pop up. It is only admin who will need to use this page
Tell me the problem, I will try tell you the solution

#9 mewhocorrupts

mewhocorrupts
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts
  • LocationParker, CO

Posted 10 August 2006 - 06:55 PM

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.
-mewhocorrupts

#10 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 10 August 2006 - 09:14 PM

I have set up the system with shopping cart ect

But I am building an affiliation script
So I was building a script where the admin can pay the affiliates
They 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 up

But for security I cant pay and  check payment, so the 2nd page is for the admin to click when the payment is confirmed
Tell me the problem, I will try tell you the solution




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users