Skip to main content
Inspiring
March 22, 2010
Question

paypal php/mysql

  • March 22, 2010
  • 1 reply
  • 1153 views

how can i get paypal ipn to update a column in mysql on success?

I have a paypal script that has the ability but I do not know how to do it. There is no documentation or a website for help.

also I need the info from the booking form to insert into the database before submitting to paypal.

I did it by adding a Summary page last time, but I need to cut down on the number of clicks

But what I really need to know is how I can redirect the form to just insert into the database and not even going to paypal if the price is 0.00 or FREE or NULL

This topic has been closed for replies.

1 reply

pziecina
Legend
March 22, 2010

Hi

how can i get paypal ipn to update a column in mysql on success?

You would have to check your paypal ipn 'complete' notification data you receive from paypal for the data required, and insert this into your database via an sql insert.

I need the info from the booking form to insert into the database before submitting to paypal.

Do this by sending your post data to a separate processing script, and inserting the required data into the database, then re-posting the data to paypal.

if the price is 0.00 or FREE

A simple -

if (price != "0.00" OR price  != "") {

code here for none free items

}

else {

code for when the item is 0.00 or free here

}

PZ

www.pziecina.com

Inspiring
March 22, 2010

"Do this by sending your post data to a separate processing script, and  inserting the required data into the database, then re-posting the data  to paypal."

I am not sure how to send the form to two scripts this is how its working at the moment:

<form action="paypal/process.php" method="post" enctype="multipart/form-data" name="booking">
  
   <label class="bday2">First Name:</label><span id="sprytextfield1">
   <input type="text" name="firstname" id="firstname" />
   <span class="textfieldRequiredMsg">A value is required.</span></span>
   <br />
  
      <label class="bday2">Ticket Type:</label><select name="amount">
   <?php if ($row_event['single_price'] !="") {?>
   <option label="Single - &pound;<?php echo $row_event['single_price']; ?>" value="<?php echo $row_event['single_price']; ?>"><?php echo $row_event['single_price']; ?></option>
   <?php } else {?>
   <option label="Single - &pound;FREE" value="0.00"></option>
   <?php };?>
   <?php if ($row_event['table_price'] !="") {?>
   <option label="Table - &pound;<?php echo $row_event['table_price']; ?>" value="<?php echo $row_event['table_price']; ?>"><?php echo $row_event['table_price']; ?></option>
   <?php } else {?>
   <option label="Table - &pound;FREE" value="0.00"></option>
   <?php };?>
   </select>

   <br /><br />
   <input name="order" type="submit" id="order" value="Order" />    
  
</form>

pziecina
Legend
March 22, 2010

Hi

You do not sent the data to two processing scripts, (it would not work).

You send the form you have at the moment to a processing script that inserts your data into the database then re-inserts the requires data into the required items for processing by the paypal script - paypal/process.php.

PZ

www.pziecina.com