好的,我举一个例子。我希望它能起作用:)
Passing data from site A to site B (the blog):
在站点A上,我想我会使用POST方法,将数据发送到站点B。我不想在url中传递参数。
在现场B,我会
$name = $_POST[\'name\'];
$email = $_POST[\'email\'];
$url = $_POST[\'url\'];
$content = $_POST[\'content\'];
$time = current_time(\'mysql\');
$data = array(
\'comment_author\' => $name,
\'comment_author_email\' => $email,
\'comment_author_url\' => $url,
\'comment_content\' => $content,
\'comment_date\' => $time,
\'comment_approved\' => 1,
);
wp_insert_comment($data);