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 6741341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:42:47+00:00 2026-05-26T11:42:47+00:00

Im trying to capture the subscribers id. Once the client subscribes and gets sent

  • 0

Im trying to capture the subscribers id. Once the client subscribes and gets sent to the ipn page, the subscribers id does not echo!

<?php
      // read the post from PayPal system and add 'cmd'
    $req = 'cmd=_notify-validate';

    foreach ($_POST as $key => $value) {
    $value = urlencode(stripslashes($value));
    $req .= "&$key=$value";
    }

    // post back to PayPal system to validate
    $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
    $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
    $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);

    // assign posted variables to local variables



      ////////////////////////////////////////////HERE
    $payer_id= $_POST['subscr_id'];
      echo 'id='.$payer_id;


      ///////////////////////////////////////////



    $item_number = $_POST['item_number'];
    $payment_status = $_POST['payment_status'];
    $payment_amount = $_POST['mc_gross'];
    $payment_currency = $_POST['mc_currency'];
    $txn_id = $_POST['txn_id'];
    $receiver_email = $_POST['receiver_email'];
    $payer_email = $_POST['payer_email'];
      if("subscr_cancel" == $_POST['txn_type']){

    if (!$fp) {
    // HTTP ERROR
    } else {
    fputs ($fp, $header . $req);
    while (!feof($fp)) {
    $res = fgets ($fp, 1024);
    if (strcmp ($res, "VERIFIED") == 0) {
    // check the payment_status is Completed
    // check that txn_id has not been previously processed
    // check that receiver_email is your Primary PayPal email
    // check that payment_amount/payment_currency are correct
    // process payment

                     $websites= "websites";
        $database = "k29803_1";
       mysql_connect("localhost", $username, $password) or die(mysql_error());
       mysql_select_db($database);

      $query = "SELECT * FROM users WHERE username= secret AND password = secret ";
      $results = mysql_query($query)or die(mysql_error());
        if(mysql_num_rows($results)==1){
            $add_credits = "UPDATE users SET credits = credits -5000
            WHERE username= 'drahoslava' AND password = 'drah0slava'";
            mysql_query($add_credits) or die(mysql_error());


          }

    }
    else if (strcmp ($res, "INVALID") == 0) {
    // log for manual investigation
    }
    }
    fclose ($fp);
    }
      }
      ?>

The button looks like this

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="NQMGM2LCZUQRE">

  <input type="hidden" name="item_name" value="1" />
    <input type="hidden" name="item_number" value="01" />
    <input type="hidden" name="amount" value="1.99" />
    <input type="hidden" name="currency_code" value="USD" />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

How can i get the subscribes id to echo? Is something wrong with the button? Should it have a notify_url?

This is what i get posted back

http://www.germcode.kodingen.com/ipn.php?tx=7ND09573SF680804M&st=Completed&amt=2.99&cc=USD&cm=&item_number=&sig=J1J%2f4phZ1VlJI1NcHAU3HxEjMgvWbv8aenml17e0GEGWfOy1CbyvaTQw60qXMf6l%2bL0LZ4GESLX6VikG%2f6UronEGf5lmKzWoXePPYdd%2bV3ep%2fXwTplJlez3NuNAxWYUHr0FGd35s15ZdTp4bOaA2yZfpWg2iLGDMQi6IN9%2f%2f8N0%3d
  • 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-26T11:42:48+00:00Added an answer on May 26, 2026 at 11:42 am

    What you’re getting posted back is not IPN data. You’ll want to set up notify_url within your PayPal form in order to receive IPN data.

    <input type="hidden" name="notify_url" value="http://www.germcode.kodingen.com/ipn.php">
    

    Note: If you’re using a so called ‘hosted button’ (all details are stored with PayPal), you can also set up IPN within your PayPal Profile, or go to the button management tool, click on Step 3, tick “Add advanced variables” and add notify_url=http://www.germcode.kodingen.com/ipn.php in the textarea.

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

Sidebar

Related Questions

I am trying to capture the contents of my php page using output buffering:
I am trying to capture urls in an html page that is being repeated
I am trying to capture read/write operations on any IMG tag's src attribute. For
I am trying to capture screenshots on test failure using selenium-client and rspec. I
I am trying to capture a url such as http://www.mysite.com/somepage.php?sometext=somevalue and redirect it to.
Problem: I am trying to capture click event of the ImageButton. I am not
I'm trying to capture repeated groups in a PHP regular expression. The expression I'm
I'm trying to capture tcp packets from a GPS device(client) configured to my server's
I trying to capture packets using SharpPcap library. I'm able to return the packets
I am trying to capture output from an install script (that uses scp) and

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.