$_POST data disappeared (from another domain) => no solutions

CORS might be an issue when trying to post things to a different domain. A Content Security Policy might also prevent it. Finally, free hosting has a security system that blocks many cross domain things: Ensuring only web browsers can access your website

And that’s all assuming your code is correct. Because I’ve personally never thought of using DOM manipulation to construct a POST request.

The first thing I would do is to open the Network tab in my browser’s Developer Tools to make sure that:

  • The POST request is actually being sent.
  • The POST parameters are set correctly.
  • No additional redirects occur between submitting the form and hitting the PHP code on the other hand (POST data is not submitted again if the first request returns a redirect).
5 Likes