我的CURL重定向不起作用,我被重定向到同一頁面,但當我提交它時呈現它時,同一頁面是空的。這是我的代碼。捲曲重定向不起作用?
$ch = curl_init("http://localhost/soft/entercode.php");
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'variable1=abc&variable2=123');
$result = curl_exec($ch);
curl_close($ch);
你應該試試這個[主題] [1] [1]:http://stackoverflow.com/questions/4023894/redirect-using-curl –