title: paypal ipn problem, url malformed (sandbox works, paypal doesn't)
body: <p>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</p>
  
  <p>This is the error with live payments:</p>
  
  <pre><code>bool(false) string(15) " malformed" 
  </code></pre>
  
  <p>this is the curl code I have:</p>
  
  <pre><code>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 =&gt; $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 .= "&amp;$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);
  </code></pre>