Page 1 of 1

How to integrate php form with PayPal?

Posted: Wed Sep 30, 2009 11:08 am
by aronjeney
On my paypal Thank You page I need to echo a php form IF a user donates over say $30. I have tried populating the posted amount into a variable, and then echoing the variable into my function but have no luck.

My code is as follows:

Code: Select all

 
 
<?php       
                  $amount = $_POST['amt'];
      
                  if ($amount >= 1) {
                  echo "
                  
                  <p>Enter your email address if you would like to receive email forecasts directly from the Colorado Avalanche Information Center.</p>
                  <form action='' method='post'><table><tr><td>Your Email:</td><td><input name='email'></td></tr></table>
                  <input type='submit' value='send'></form>";
                  
                  } else {
                  echo ("<p>Thank you for your donation of $amount.</p>");
                  }
 
                  
                  ?>
 
 

The problem is not with the form itself, but rather the communication of the variable "amt" working with the paypal $amount. I am a designer and have been banging my head :banghead: over this particular problem for too long now and i believe it is something very minor that needs changing.

All and any help is much appreciated.

Re: How to integrate php form with PayPal?

Posted: Wed Sep 30, 2009 11:59 am
by mayanktalwar1988

Code: Select all

 
<form  action="test1.php" method="post">
 
<input type="text" name="amt" />
<input type="submit" value="Submit" />
</form>
 
with the above input form

and with your script which i named as test1.php
worked fine for me

i think there is problem in the script which contains the form post that script

Re: How to integrate php form with PayPal?

Posted: Wed Sep 30, 2009 12:15 pm
by aronjeney
What exactly did you get to work? I am trying to display that form IF a user donates more than $30 from our paypal account. I didnt think it was in the form as I ran a test to verify that the form worked properly on its own and it did. The issue is that I am trying to make that form display only after they have donated over $30.

I hate to be so ignorant to PHP but I am a designer learning as I go and I appreciate all help. Any more ideas? My client is nagging the hell out of me.

Re: How to integrate php form with PayPal?

Posted: Wed Sep 30, 2009 12:27 pm
by mayanktalwar1988
it displayed the form which makes you to input the email..change this

Code: Select all

if ($amount >= 1)
to

Code: Select all

if ($amount >= 30)
and it will work for more than 30 dollars
if i am not wrong