次のコードがあります。
$poststr = "param1=<html><head></head><body>test1 & test2</body></html>¶m2=abcd¶m3=eeee";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "http://www.mytest.com");
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookiefile);
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookiefile);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $poststr);
curl_setopt($curl, CURLOPT_ENCODING, "");
$curlData = curl_exec($curl);
投稿が機能していません。param1 に HTMl が含まれていることが原因だと思います。でも使ったらhtmlentities()
ダメ。使用してみましurlencode()
たが、まだうまくいきません。