<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$name = $_POST['name'];
$name = $_POST['name'];
// 处理表单数据
}
$url = 'http://yiqq.opaoaeo.net/'; // API接口地址
$data = array(
'name' => 'wo',
'email' => '测試',
);
$options = array(
CURLOPT_RETURNTRANSFER => true, // 返回结果保存到变量中
CURLOPT_POST => true, // 使用POST方式提交数据
CURLOPT_POSTFIELDS => $data, // POST数据
);
$ch = curl_init($url);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
curl_close($ch);
?>