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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:01:52+00:00 2026-05-22T15:01:52+00:00

I have following HTML form <form action=https://sandbox.paypal.com/cgi-bin/webscr method=post id=paypalpost name=paypalpost> <input type=hidden name=rm value=2/>

  • 0

I have following HTML form

<form action="https://sandbox.paypal.com/cgi-bin/webscr" method="post" id="paypalpost" name="paypalpost">
                <input type="hidden" name="rm" value="2"/>
                <input type="hidden" name="cmd" value="_xclick">
                <input type="hidden" name="business" value="vbnetdiscuss@yahoo.com">
                <input type="hidden" name="item_name" value="Wedding Gift">
                <input type="hidden" name="currency_code" value="EUR">
                <input type="hidden" name="amount" value="<?php echo $value['total'];?>">
                <input type="hidden" name="return" value="http://developwithus.com/wedding/return.php">
                <input type="hidden" name="cancel_return" value="http://developwithus.com/wedding/return.php?status=0">


            <input onclick="return submitatoc();" disabled type="submit" name="submit" id="pay" class="buttonBlueBg" value="Checkout" style="cursor:pointer;">

            </form>

I had mentioned return URL as http://developwithus.com/wedding/return.php
on which, (I had download this from : https://cms.paypal.com/cms_content/US/en_US/files/developer/IPN_PHP_41.txt and add

<?php 
print_r('<pre>');
print_r($_POST);
// 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.sandbox.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'];

if (!$fp) {
// HTTP ERROR
    echo "HTTP Error";
} else {
    fputs ($fp, $header . $req);
    while (!feof($fp)) {
        $res = fgets ($fp, 1024);
        echo $res;
        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
            echo("verified");
        }
        else if (strcmp ($res, "INVALID") == 0) {
            // log for manual investigation
            echo ("invalid");
        }
    }
    fclose ($fp);
}
echo "end";
?>

but I got Bad Request as response, If I go to paypal sand box account and made payment and return back.

Array
(
   [CONTEXT] => wtgSziM4C5x0SI-9CmKcv2vkSeTLK5P_g6HqzC__YTYkcqziFNcB84p79Ja
   [myAllTextSubmitID] => 
   [cmd] => _flow
   [mc_gross] => 100.00
   [protection_eligibility] => Ineligible
   [address_status] => confirmed
   [payer_id] => Z5NWSYYVZW268
   [tax] => 0.00
   [address_street] => 1 Main St
   [payment_date] => 09:04:08 May 14, 2011 PDT
   [payment_status] => Pending
   [charset] => windows-1252
   [address_zip] => 95131
   [first_name] => Test
   [address_country_code] => US
   [address_name] => Test User
   [notify_version] => 3.1
   [custom] => 
   [payer_status] => verified
   [address_country] => United States
   [address_city] => San Jose
   [quantity] => 1
   [payer_email] => sujeet_1302606445_per@gmail.com
   [verify_sign] => AozIjtjfCe0jUnbJpR4qPrW54olKAq.SrnEktGSocrk8yYv4bpR4lJX7
   [txn_id] => 3HG58230W32603443
   [payment_type] => instant
   [last_name] => User
   [address_state] => CA
   [receiver_email] => vbnetdiscuss@yahoo.com
   [pending_reason] => unilateral
   [txn_type] => web_accept
   [item_name] => Wedding Gift
   [mc_currency] => EUR
   [item_number] => 
   [residence_country] => US
   [test_ipn] => 1
   [transaction_subject] => Wedding Gift
   [handling_amount] => 0.00
   [payment_gross] => 
   [shipping] => 0.00
   [merchant_return_link] => click here
   [form_charset] => UTF-8
)
HTTP/1.1 400 Bad Request
Date: Sat, 14 May 2011 16:05:20 GMT
Server: Apache
Set-Cookie: c9MWDuvPtT9GIMyPc3jwol1VSlO=%7cgA9mW0Yh7-iBp435VBDwyCqtOtnlE8KAk8fT_sjGXHGx2mDzXgFit5ZdHd3BOOEUt_UDRW%7cRD1g8aAyLevIAP-u4WfCokEQkimrkpQk6v6rLZ_xD-pT1ATWuv5RtcK3NIbPPwfF1cXq3G%7c; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: cookie_check=yes; expires=Tue, 11-May-2021 16:05:20 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: Apache=10.191.196.11.9095130538912094; path=/; expires=Fri, 31-Mar-05 09:37:04 GMT
Connection: close
Content-Type: text/plain; charset=ISO-8859-1

can you guys tell me what I’m doing wrong?
INVALID response is working

  • 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-22T15:01:52+00:00Added an answer on May 22, 2026 at 3:01 pm

    Remove your *.paypal.com cookies.
    This an unfortunate bug in the PayPal system, where the cookie gets too large and the server errors out on it.
    You can avoid the problem by using two different browsers, e.g. IE for PayPal Live and FF for the PayPal Sandbox.

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

Sidebar

Related Questions

I have a form with the following HTML below: <form id=course_edit_form name=course_form action=/courses/save method=post>
in the form action i have the following line\ <form action={URL} method=post target=_self id=xxx
I have the following HTML <div> <img id=image1 src=http://valleywag.com/assets/resources/2008/03/BlackGoogleLogo.jpg alt=Why doesn't this float correcly?
I have the following form in cakephp: <div class=quickcontactDisplay> <?php echo $form->create('Enquiry',array('action'=>'add','class'=>'quickcontact')); echo $form->hidden('visitor_id',
I have the following html.erb code that I'm looking to move to Haml: <span
I have the following HTML <select> element: <select id=leaveCode name=leaveCode> <option value=10>Annual Leave</option> <option
I have the following HTML (note the CSS making the background black and text
I have the following html code: <h3 id=headerid><span onclick=expandCollapse('headerid')>&uArr;</span>Header title</h3> I would like to
I have the following HTML node structure: <div id=foo> <div id=bar></div> <div id=baz> <div
I have the following HTML to center images and links within a layer: edit:

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.