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

  • SEARCH
  • Home
  • 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 8900025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:00:12+00:00 2026-06-15T01:00:12+00:00

I’m using Micha’s PayPal IPN script and for the most part it worked great:

  • 0

I’m using Micha’s PayPal IPN script and for the most part it worked great: https://github.com/Quixotix/PHP-PayPal-IPN

When i click Pay now on the website it redirects to paypal with correct information, allows payment to be made, but on return nothing happens, ie it does not upgrade the user as it should. Now i’ve tested the script my code outside of the IPN and it works perfect so it looks to me like the IPN script is losing the session?

Here is my button code:

<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="EMAIL_TO">
    <input type="hidden" name="currency_code" value="GBP">
    <input type="hidden" name="item_name" value="Text Light">
    <input type="hidden" name="amount" value="0.01">
    <input type="hidden" name="return" value="http://domain.co.uk/editors">
    <input type="hidden" name="notify_url" value="http://domain.co.uk/account/upgrade">
    <input type="submit" value="Pay now" class="btn btn-preview" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

So the notify url (IPN code) is /account/upgrade — as far as i know this is where it should perform the upgrade task? so here is my (stripped down) code

if ($verified) {

    $errmsg = '';

    // some error checking

    if (!empty($errmsg)) {

        // manually investigate errors from the fraud checking

    } else {

        // upgrade user
        $package = serialize($_SESSION['package']);
        $this->db->update('users',array('id' => $_SESSION['user']['id']),array('payment_plan' => $package));

    }

} else {

    // not verified, investigate problems
}

As above, the code under ‘// upgrade user’ works fine outside, but on return from paypal it’s obviously not keeping hold of the session. It’s not throwing any errors, it’s just not doing anything.

Where have i gone wrong? how can i ensure that session information will be passed back from PayPal.

Thanks

  • 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-06-15T01:00:14+00:00Added an answer on June 15, 2026 at 1:00 am

    Your question has a short answer: IPN isn’t done as the user.

    To expand on the answer, here’s how IPN works. You make a payment, your visitor returns to your site, and PayPal pings your IPN URL. The important bit is in bold – the request will come from PayPal and not from the user, and will therefore not inherit the user’s session!

    The reason for this is pretty simple – the IPN URL is supposed to be private, as you could do all sort of silly shenanigans if it wasn’t (including creating virtual transactions). For this very reason, the user never sees this address. (Another reason is that not all browsers will follow redirects – and IPN is designed to provide information 100% of the time).

    If you would like to do this, you’ll need to pass a parameter to the IPN request indicating who the user is. Passing the user ID is a very bad idea – as parameters as modifiable. Instead, generate a transaction ID of some sort containing the info on the user, and pass this. On the IPN call, you’ll get this variable back as a custom parameter, which will allow you to fetch stuff from your DB and do whatever you want, knowing who the user was.

    Hope this helped.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
We're building an app, our first using Rails 3, and we're having to build

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.