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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:20:16+00:00 2026-05-23T12:20:16+00:00

For some reason my script connects to the database and has no errors however

  • 0

For some reason my script connects to the database and has no errors however nothing in the database seems to update. I cannot find anything wrong with it. Here is my code:

    // 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
    $item_name = $_POST['item_name'];
    $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'];
    $user_id = mysql_real_escape_string($_POST['custom']);
    $today = date("F j, Y, g:i a"); 

    echo "hi";

    if (!$fp) {
       // HTTP ERROR
    } else {
      fputs ($fp, $header . $req);
      while (!feof($fp)) {
        $res = fgets ($fp, 1024);
        if (strcmp ($res, "VERIFIED") == 0) {
            if ($payment_status=='Completed') {
                $txn_id_check = mysql_query("SELECT 'txn_id' FROM 'log' WHERE 'txn_id' ='".$txn_id."'");
                if (mysql_num_rows($txn_id_check) !=1) {
                    if ($receiver_email=='HiddenForStackQuestion') {
                        if ($payment_amount=='29.95' && $payment_currency=='USD') {
                        $log_query = mysql_query("INSERT INTO 'log' VALUES ('','".$txn_id."','".$payer_email."')");
                        $update_premium = mysql_query("UPDATE 'users' SET authLevel='1', startDate='".$today."'  WHERE 'fbID'='".$user_id."'");

                        }

                        }

                    }
            }


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

And Here is my button.

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick-subscriptions">
    <input type="hidden" name="business" value="hiddenForStackQuestion">
    <input type="hidden" name="lc" value="US">
    <input type="hidden" name="item_name" value="hiddenForStackQuestion">
    <input type="hidden" name="no_note" value="1">
    <input type="hidden" name="no_shipping" value="2">
    <input type="hidden" name="rm" value="1">
    <input type="hidden" name="return" value="hiddenForStackQuestion">
    <input type="hidden" name="cancel_return" value="hiddenForStackQuestion">
    <input type="hidden" name="src" value="1">
    <input type="hidden" name="a3" value="29.95">
    <input type="hidden" name="p3" value="1">
    <input type="hidden" name="t3" value="Y">
    <input type="hidden" name="notify_url" value="hiddenForStackQuestion" />
          <input type="hidden" name="custom" value="<?php echo $userId ?>" />
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHosted">
    <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!" style="border:none;">
    </form>

I have been on this for awhile but am having no luck. Anyone see what is wrong?

  • 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-23T12:20:16+00:00Added an answer on May 23, 2026 at 12:20 pm

    This

    <input type="hidden" name="notify_url" value="hiddenForStackQuestion" />
    

    Doesn’t happen to be hosted on localhost, I hope?
    An IPN POST is initiated by PayPal’s servers, and as such must be a FQDN. localhost won’t work.

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

Sidebar

Related Questions

For some reason, no matter how I go about it, I cannot get TortoiseSVN
I have the following shell script. For some reason the java program's standard error
I have a bash script which serves as a driver basically. For some reason
For some reason the script below is not working. This is the code I
The pagination script I use doesn't display the posts for some reason. It displays
for some reason my Firefox4+GreaseMonkey Script loads jQuery twice. I copy'n'pasted the following snippet,
I created a script that resizes images based on their ratio. For some reason,
For some reason, on some of my pages, the default validator script isn't rendering
For some reason, I cannot figure out how to return the value of an
For some reason this script prints string are equal #!/bin/bash A='foo' B='bar' if [

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.