title: Way to send POST data to a PHP file from another PHP file?
body: <p>Alright, so I've looked at a ton of questions, but I only found 1 that resembled what I am trying to do. Here is the link to it: <a href="https://stackoverflow.com/questions/679701/passing-post-data-from-one-web-page-to-another-with-php">Passing POST data from one web page to another with PHP</a> </p>
  
  <p>I want to pass data from one PHP file(we'll call it editData.php) to another PHP file(we'll call it submitData.php). Neither file has any HTML elements (pure PHP code I mean). The first file(editData.php) receives $_POST data, edits it, and needs to send it to the second file. The second file(submitData.php) needs to be able to read in the data using $_POST. <strong><em>No sessions nor cookies</em></strong> can be used I'm afraid.</p>
  
  <p>In the linked question above, the answer accepted was to create hidden fields inside a form and POST the data from there. This worked for the OP because he had user interaction on his "editData.php", so when the user wanted to go to "submitData.php", he would POST the data then.</p>
  
  <p>I can't use this solution(at least, I don't think I can), because I am accessing (and sending $_POST data to) editData.php from a javascript AJAX call and there will be no user interaction on this page. I need the modified data to be POSTed by code, or some other way that does the transfer 'automatically'(or 'behinid-the-scenes' or whatever you want to call it). submitData.php will be called right after editData.php.</p>
  
  <p>I don't know if I can rewrite submitData.php to accept GET data, so count that out as well (it's a matter of being able to access the file). I really don't want to echo stuff back to my original JavaScript function(and then AJAX again). I am encrypting info in editData.php, and (while it sounds silly to say it) I don't want to make it easy for someone to develop a cipher for my encryption. Returning values after being encrypted(viewable with Inspect Element) would make it too easy to decipher if you ask me.</p>
  
  <p>I feel like this issue could come up a lot, so I'd expect that there is something obvious I'm missing. If so, please tell me.</p>
  
  <p>tl;dr? <strong>How can I send data to a PHP file via the POST method while only using code in another PHP file?</strong></p>