October 9, 2018
PHP: 模拟 POST 提交表单, Sending POST data without form, send a POST request with PHP

方法有很多种,比如用 AJAX:
$.post('/foo.php', { key1: 'value1', key2: 'value2' }, function(result) {
alert('successfully posted key1=value1&key2=value2 to foo.php');
});
又比如用CURL:
function httpPost($url, $data)
{
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_qu… Read More