日期:2014-05-16 浏览次数:20703 次
$post_url = "http://domain.com/post.php";
$post_data = array(
'color' => array('red', 'green', 'blue'),
'img' => "@d:\image.jpg"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $post_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, ($post_data));
if (false === curl_exec($ch)) {
echo "Curl_error: " . curl_error($ch);
}
curl_close($ch);
$post_data = array("method" => $_POST["method"],
"mode" => $_POST["mode"],
"product[name]" => $_POST["product"],
"product[cost]" => $_POST["product"]["cost"],
"product[thumbnail]" => "@{$_FILES["thumbnail"]["tmp_name"]}");
<?php
$post_url = "http://localhost/test/test1.php";
$post_data = array(
'a[1]' => 'red',
'b[