Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6644059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:07:24+00:00 2026-05-26T00:07:24+00:00

I have setup a PayPal IPN file. When the user is at the site

  • 0

I have setup a PayPal IPN file. When the user is at the site and press submit details about the transaction is uploaded to the db. The relevant id is sent via PayPal as the custom field. When payment complete IPN used to update DB as transaction completed based on id.

All is fine.

However, this is the tricky bit. I also need to update another table – a discount/coupon code db. The update is based on the code entered and also the number of times the code can still be used. Basically if it was 50 times, after used once the db would be updated with 49. So I need to pass the code and the remaining uses allowed so can say update table where code = XXXX (update new value of 49 etc).

I can work out how to pass all these values in the custom field, but cannot work out how to parse them out again? Read about separating them with : etc, but need some advice from someone who has done before.

This is how IPN details currently comes back:

$custom = $_POST[‘custom’];

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:07:24+00:00Added an answer on May 26, 2026 at 12:07 am

    I did just this recently,
    Send your paypal custom field to data as your would, inside that custom field, use a separator to split your data.
    In the below example, the values are split using a “|”, you can use any character you want available in your charset.

    $member_id = 1;
    $some_other_id = 2;
    <input type="hidden" name="custom" value="<?php echo $member_id.'|'.$some_other_id ?>"/>
    

    This will output:

    <input type="hidden" name="custom" value="1|2"/>
    

    When you get the information from paypal (the IPN response) process it like so:

    $ids = explode('|', $_POST['custom']); // Split up our string by '|'
    // Now $ids is an array containing your 2 values in the order you put them.
    $member_id = $ids[0]; // Our member id was the first value in the hidden custom field
    $some_other_ud = $ids[1]; // some_other_id was the second value in our string.
    

    So basically, we send a string with a custom delimiter that we choose to paypal, paypal will return it to us in the IPN response. We then need to split it up (using the explode() function) and then do what you would like with it.

    When you get your value from the database your select it using normal methods, then just decrement it by 1 using:

    $val_from_db--; // Thats it!, Takes the current number, and minus 1 from it.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PayPal IPN PHP file set up which assigns all of the
I have a PayPal Premier account, setup with IPN and with Ubercart's IPN return
I have setup file of winform. but i want to change my icon how
I have a php site with a member system, and set up a paypal
I have my website and opened a paypal business account. I have setup the
I have setup a SharePoint site with forms authentication and My Sites. The users
I've set up a PHP IPN Paypal notification handler on my site to notify
I've setup a PayPal sandbox. I have created a buy now button with a
Has anyone setup django-paypal? Here is the link to it here ? I have
I have setup my site with 5 pages which are my menu options. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.