I'm writing a php file that can send the same form data to different urls on different servers.
<?php
$urls = array("some_url_num1.php", "some_url_num2.php", "some_url_num3.php");
foreach ($urls as $url) {
echo '<form action="'.$url.'" method="post">
Time From: <br> <input type="text" name="timefrom"><br>
Time to: <br><input type="text" name="timeto"><br>
Password: <br> <input type="password" name="password"><br>
<input type="submit"><br></form>';
}
?>
Currently there are 3 forms on the page, and the user needs to enter the same data (timefrom, timeto, password) three times in order to get the result from some_url_num1.php, some_url_num2.php, some_url_num3.php.
Is there anyway, using php, to let the user enter only once, and get the result from the three .php files?
Create a single form
Collect data in a single php file
From that php file, send user submitted data to other urls using curl
For CURL details you can refer PHP manual
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.