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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:09:08+00:00 2026-05-25T23:09:08+00:00

I have an IPN file that works perfectly in sandbox. It returns valid or

  • 0

I have an IPN file that works perfectly in sandbox. It returns valid or not and executes the code correctly. However if I try real live payments it tells me the url is malformed

This is the error with live payments:

bool(false) string(15) " malformed" 

this is the curl code I have:

if($testmode === true)
{
    $paypalaction = "https://www.sandbox.paypal.com/cgi-bin/webscr";
}
elseif($paypal == "paypal")
{
    $paypalaction = "https://www.paypal.com/cgi-bin/webscr";
}
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value)
{
   // If magic quotes is enabled strip slashes
   if (get_magic_quotes_gpc())
   {
       $_POST[$key] = stripslashes($value);
       $value = stripslashes($value);
   }
   $value = urlencode($value);
   // Add the value to the request parameter
   $req .= "&$key=$value";
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$paypalaction); 
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
$res = curl_exec($ch);
var_dump($res);
var_dump(curl_error($ch));
curl_close($ch);
  • 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-25T23:09:09+00:00Added an answer on May 25, 2026 at 11:09 pm

    The problem wasn’t with paypal or sandbox but just me being stupid. i had the following if statement:

    if($testmode === true)
    {
        $paypalaction = "https://www.sandbox.paypal.com/cgi-bin/webscr";
    }
    elseif($paypal == "paypal")
    {
        $paypalaction = "https://www.paypal.com/cgi-bin/webscr";
    }
    

    But the $paypal variable wasn’t used anymore so it never entered the elseif statement. I should have been only an if else:

    if($testmode === true)
        {
            $paypalaction = "https://www.sandbox.paypal.com/cgi-bin/webscr";
        }
        else
        {
            $paypalaction = "https://www.paypal.com/cgi-bin/webscr";
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code at the end of my models.py file from paypal.standard.ipn.signals import
I have a PayPal IPN file that doesn't seem to work. It is very
I have a PayPal IPN PHP file set up which assigns all of the
I have a script that sends an email using the paypal IPN after a
I have used the sandbox to get informations returned by Paypal IPN after a
I'm using Micah Carrick's PHP Paypal IPN Integration Class and have code in paypal.class.php
If I have received an IPN that tells me the transaction (txn_id=123) is completed
I have setup a PayPal IPN file. When the user is at the site
I have development site on localhost, Sandbox set IPN return url to external IP,
I have a working IPN script. It is updating the data correctly in database

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.