I am going to try and explain this as best I can, I hope that I make sense as English is not my first language.
Lets say that I have a form on page 1 which contains these 3 inputs:
$_POST["name"];
$_POST["amount"];
$_POST["email"];
And on a second page process.php I also have another input:
$_POST["message"];
And finally on an external website there is a form that I want to POST to without having to type anything into their system:
<form action="display.php" method="post">
<input type="text" name="name"><br>
<input type="text" name="amount"><br>
<input type="text" name="email"><br>
<input type="text" name="message"><br>
<input type="submit">
</form>
I then want to be able to be automatically redirected to www.example.com/display.php from my process.php page and submit the form automatically and be able to see all of my information that I just entered
Example of what display.php looks like:
I do not have access to the code on the external website or display.php so this means that I cannot edit the code or use any sessions.
I hope that you understand me and that you could be able to help me, I would be so grateful if you could help me!
EDIT:
I tested some code that I was given in an answer and looks promising but it didn't pass the POST data to the external page (Which is not external for testing purposes)
Here is the code used to test below:
process.php
<?php
$_POST["name"] = "name";
$_POST["amount"] = "amount";
$_POST["email"] = "email";
$_POST["message"] = "message";
$post = array();
$post[] = "name=" . $_POST["name"];
$post[] = "amount=" . $_POST["amount"];
$post[] = "email=" . $_POST["email"];
$post[] = "message=" . $_POST["message"];
$ch = curl_init('http://localhost/display');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
header('Content-Type: text/html');
echo curl_exec($ch);
?>
display.php
<?php
echo $_POST["name"];
echo $_POST["amount"];
echo $_POST["email"];
echo $_POST["message"];
?>
But for some reason this did not work?