所以,我有这个 cURL 代码,我在网上找到了一个模板
<?php
//create array of data to be posted
$post_data['ssl_merchant_id'] = 'xxx';
$post_data['ssl_user_id'] = 'xxx';
$post_data['ssl_pin'] = 'xxx';
$post_data['ssl_transaction_type'] = 'xxx';
$post_data['confirm_code'] = $_POST['confirm_code'];
$post_data['ssl_show_form'] = 'xxx';
$post_data['ssl_cardholder_ip'] = $_POST['ssl_cardholder_ip'];
$post_data['ssl_amount'] = $_POST['ssl_amount'];
//traverse array and prepare data for posting (key1=value1)
foreach ( $post_data as $key => $value) {
$post_items[] = $key . '=' . $value;
}
//create the final string to be posted using implode()
$post_string = implode ('&', $post_items);
//create cURL connection
$curl_connection =
curl_init('xxx/cart2.php');
//set options
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
//set data to be posted
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
//perform our request
$result = curl_exec($curl_connection);
//show information regarding the request
print_r(curl_getinfo($curl_connection));
echo curl_errno($curl_connection) . '-' .
curl_error($curl_connection);
//close the connection
curl_close($curl_connection);
echo $result;
?>
我的问题是,如何调用要在 cart2.php 页面上使用的已发布变量,我将使用这些已发布变量在 cart2.php 页面上填写另一个表单,然后将该页面提交到另一个页面。或者有什么方法可以放置重定向或保存最后一页的帖子变量的东西?