<?
$ch = curl_init();
$curlConfig= array(CURLOPT_URL => 'www.iwav.co.kr/sub.html',
CURLOPT_HEADER => ture,
CURLOPT_POSTFIELDS => array('section' => 'sc2',),
);
$c1=curl_setopt_array($ch,$curlConfig);
if($c1)
{
echo"<font color=red>$c1 : c1</font><br>";
}
else
{
echo"c2";
}
$result = curl_exec($ch);
if($result)
{
echo"<font color=red>$result : c3</font><br>";
}
else
{
echo"c4";
}
curl_close($ch);
?>
=================================================================
<?
if($m=="ok")
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://syndication.openapi.naver.com/status/?site=www.newswave.kr");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
$result = curl_exec($ch);
curl_close($ch);
?>
<?
$title="한글 aaaaaaaa";
// $title=urlencode($title);
$ch = curl_init();
$curlConfig = array(
CURLOPT_URL => "demo100.mygoodnews.com/bbs/bbs_exe.php",
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => array("Table"=>"ins_bbs2","exec"=>"input","bbs_title" =>"$title","nospam"=>"1276","name"=>"zzzz"),
);
$c1=curl_setopt_array($ch,$curlConfig);
if($c1)
{
echo"<font color=red>$c1 : c1</font><br>";
}
else
{
echo"c2";
}
$result = curl_exec($ch);
exit;
if($result)
{
echo"<font color=red>$result : c3</font><br>";
}
?>
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_exec($ch);
$meta = curl_getinfo($ch);
curl_close($ch);
print_r($meta);
if($meta['http_code'] == 200)
{
echo "title: $meeage <br>";
}
else
{
echo "fail <br>";
}