title: Sending ajax request to php fails
body: <p>I am sending a string via ajax request to my php file which encodes the string. That works, in the debugger console I recieve the full encoded string. </p>
  
  <p>I want to combine the encoded string with another variable but it dont work it gives me 500 Server error, i tried different solutions but none of them works.</p>
  
  <pre><code>$(document).ready( function() {
                    $("#paybutton").click(function() {
                                          var params = "projectpaymentoption=1111&amp;id=",
                                          usernamepay = window.localStorage.getItem("username"),
                                          paymenturl = params + usernamepay;
  
                                          $.ajax({
                                                 type: 'POST',
                                                 url: 'http://www.blabla.de/phone/encode.php',
                                                 data: $.param({"paymenturl": paymenturl}),
                                                 success: function(result) {
                                                 window.open('result','_blank','location=no','closebuttoncaption=Zurück');                                                   
                                                 console.log(result);
                                                 }
                                                 });
                                          });
                    });
  </code></pre>
  
  <p>Here my Encode.php:</p>
  
  <pre><code>&lt;?php
  
  print_r($_POST); // see full contents of the POST
  $user = $_POST['paymenturl'];
  print PHP_EOL . $user . PHP_EOL; // see full contents of the $user var
  $password = "blabla"; 
  $salt = "blabla";
  
  function encode($password,$decrypted,$salt){    
  $key = hash('SHA256', $salt . $password, true);    
  $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128,  
  MCRYPT_MODE_CBC), MCRYPT_RAND);   
  if (strlen($iv_base64 = rtrim(base64_encode($iv), '=')) != 22) {  
  throw new Exception("Encoding failed!");  
  }  
  $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key,   
  $decrypted . md5($decrypted), MCRYPT_MODE_CBC, $iv)); 
  return urlencode($iv_base64 . $encrypted);  }
  
  $en = encode($password,$user,$salt);
  
  $output = array "http://pay4mobile.com/Payments/Connect/1111/DE?o={$en}";
  echo json_encode($output);
  ?&gt;
  </code></pre>
  
  <p>I want to combine the $en variable with "<a href="http://pay4mobile.com/Payments/Connect/1111/DE?o=" rel="nofollow">http://pay4mobile.com/Payments/Connect/1111/DE?o=</a>" and give it back to phonegap inappbrowser which opens but dont work. What i am doing wrong?</p>