Send data with post to other drupal page not working I'm trying to send data from a html form to another drupal page. 

The Form (in JavaScript):

var data = { // JS Object with data to send
            priceUnit: '131.97', 
            priceTotal: '131.97', 
            priceCount: '1', 
            articleNumber: 'XYZ'
        }; 
        // Form creation
        var form = document.createElement("form");
        form.style.display = 'none';
        // link to drupal site
        form.action = "../configurator/process_order";
        form.method = "post";
        form.target = "_blank";

        // Create form Content from JS Object data
        for (var key in data)
        {
            var input = document.createElement("input");
            input.name = key;
            input.value = data[key];
            form.appendChild(input);
        }
        document.body.appendChild(form);
        form.submit();   


On the other page, I am trying to access php $_POST but there is no output: 

&lt;div&gt;
     &lt;?php
         echo $_POST['priceUnit']; 
     ?&gt;
&lt;/div&gt;


But, if I add var_dump($_POST); in my module: configurator.module: 

function configurator_process_order()
{
    var_dump($_POST);


    $modulePath = drupal_get_path('module', 'configurator');

    $content = file_get_contents($modulePath . "/Trader/PHPWebPages/processOrder.php");
    return mb_convert_encoding($content, 'UTF-8', mb_detect_encoding($content, 'UTF-8, ISO-8859-1', true));
}


I get the following output: 

array (size=4)
  'priceUnit' =&gt; string '131.97' (length=6)
  'priceTotal' =&gt; string '131.97' (length=6)
  'priceCount' =&gt; string '1' (length=1)
  'articleNumber' =&gt; string 'XYZ' (length=3)


So the form has submitted it's data but I cannot access it on my drupal page.
What am I doing wrong?
Your code:

&lt;div&gt;
     &lt;?php
         echo $_POST['priceUnit']; 
     ?&gt;
&lt;/div&gt;


is probably in one of the tpl.php files. They are cached. You are not passing any data from any module to your template file, so Drupal cannot know it is not supposed to be cached. That's all.

Access post data in your module file, and pass it to your template properly, the "Drupal way" you can see in Examples, and you'll be good.

Also, I strongly suggest to remember that POST data is user-agent provided and you should never trust it. Especially not for things like price! There is a Drupal Form API to automate tests, but what you really should pass around is item's ID, and it's price should always come from your database, not from your user.

Price supplied by client is a recipe for a legal disaster.