title: Passing on data from Jquery to php superglobals not working
body: <p>I am trying to pass data from my js file with Jquery to php. However, when I send the request through the browser, i get the value null back. My php class $imageurl is not set, neither is my super global $_POST. I have no idea why this occurs, cause if I set the fullimgurl through postman, my php request is fully working. I have tried to sent it back decoded and also encoded. none of it seems to work, which is weird since it works through postman.</p>
  
  <p>Here is my Jquery code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js”&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form enctype="multipart/form-data"&gt;
  &lt;input type="file" accept="image/*" onchange="loadFile(event)" &gt;
  &lt;button name="submit" id="submit"&gt;&lt;/button&gt;
  &lt;/form&gt;
  
  
  &lt;img src="" id="output"/&gt;
  
  &lt;div id="textOutput"&gt;&lt;/div&gt;
  
  &lt;script&gt;
  var imgfullurl;
  
  $("#submit").on('click', function(e) {
      e.preventDefault();
      $.ajax({
          url: 'test1.php',
          type: 'POST',
          data: { imgfullurl: imgfullurl },
          dataType: "json",
          contentType : "application/json",
          success: function (data) {
              $('#textOutput').html(data);
              console.log(data);
          },
          error: function (error) {
              alert(error);
          }
      })
  })
  
  
  var loadFile = function(event) {
      var reader = new FileReader();
      reader.onload = function(){
          var output = document.getElementById('output');
          output.src = reader.result;
          imgfullurl = reader.result;
          console.log('imageurl');
          console.log(imgfullurl);
      };
      reader.readAsDataURL(event.target.files[0]);
  
  };
  
  
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And here is my php file: </p>
  
  <p>
  
  <pre><code>if (isset($_POST['imgfullurl'])){
  $imageurl = $_POST['imgfullurl'];
  }
  
  echo json_encode($imageurl);
  </code></pre>