你需要使用捲曲了點。上有一個很大的教程由davidwalsh here
//extract data from the post
//set POST variables
$url = 'http://domain.com/get-post.php';
$fields = array(
'lname' => urlencode($_POST['last_name']),
'fname' => urlencode($_POST['first_name']),
'title' => urlencode($_POST['title']),
'company' => urlencode($_POST['institution']),
'age' => urlencode($_POST['age']),
'email' => urlencode($_POST['email']),
'phone' => urlencode($_POST['phone'])
);
//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string, '&');
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
//execute post
$result = curl_exec($ch);
//close connection
curl_close($ch);
的file_get_contents( 'your_target_url');可以從您請求的網址獲取數據。 – ameenulla0007
file_get_contents不適用於後期 - 谷歌捲曲,(捲曲URL請求庫) –
是的,你可以捲曲這 – devpro