此代码似乎有效,因为网页会响应"感谢您提交"
$url = "http://www.mamamia.gr/diag_v/index.php?name=James&eponimo=Vasdanoi&age=34&email=ddd401@gmail.com&thl=4747428928"
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$output=curl_exec($ch);
curl_close($ch);
echo $output;
但我认为以下代码不起作用,因为网页没有响应任何内容
$url = "http://www.mamamia.gr/diag_v/index.php"
$fields_string = 'name=James&eponimo=Vasdanoi&age=34&email=ddd401@gmail.com&thl=4747428928';
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
$output=curl_exec($ch);
curl_close($ch);
echo $output;
你可以建议吗?