I have a php script on a web server that's called over the internet and then accesses the $_POST array to retrieve the passed data. Beside calling this script from the web page (<form action="form.php" method="post">) I'm also able to call it from a local bash script running on the server:
postData='form_name=Georg&form_email=george%40example.com&form_message=Something%20new&id_button=true'
curl -X POST -d $postData https://example.com/form.php
Now I want to get rid of curl and call the script directly with the data I have prepared, like:
php /var/www/example/form.php -- $postData
How do I prepare and pass the $postData correctly, such that I don't have to change the script and can access the passed data, like $_POST['form_email'], as though called over the internet?