///파싱기 시작
echo $wr_subject
include a.php
///파싱기 끝
궁금한점 : (절대 불법 수집 아닙니다)
파란색에서 echo를 해보면 정상적으로 새로운 값이 출력되는데요
인클루드시킨 a.php는 파싱된 첫번째 값만 넘어가고 그후로는 넘어가지 않습니다
이 문제가 해결되지 않아. 꿈에서도 해보는 중입니다
a.php의 소스는 아래와 같습니다
헌이님이 만드신 블로그로 글보내기 소스입니다
Copy
<?php
include_once 'xmlrpc.inc'; // 파일 첨부함.
function newPost($title, $description)
{
$g_blog_url = "xxxxx";
$user_id = "xxxxx";
$blogid = "xxxxxx";
$password = "xxxxxx";
$publish = true;
$client = new xmlrpc_client($g_blog_url);
$client->setSSLVerifyPeer(false); // 기본값은 true인데, false로 설정하지 않으면 SSL 에러남.
$GLOBALS['xmlrpc_internalencoding']='UTF-8'; // 기본값은 ISO-8859-1, 기본값 사용시 한글 깨짐.
$struct = array(
'title' => new xmlrpcval($title, "string"),
'description' => new xmlrpcval($description, "string")
);
$f = new xmlrpcmsg("metaWeblog.newPost",
array(
new xmlrpcval($blogid, "string"),
new xmlrpcval($user_id, "string"),
new xmlrpcval($password, "string"),
new xmlrpcval($struct , "struct"),
new xmlrpcval($publish, "boolean")
)
);
$f->request_charset_encoding = 'UTF-8';
return $response = $client->send($f);
}
?>
<?
$return = newPost(iconv('UTF-8', 'UTF-8' ,''. $wr_subject ), iconv('UTF-8', 'UTF-8',''. $wr_content));
?>
|
답변 2개 / 댓글 1개
채택된 답변
+20 포인트
답변을 작성하려면 로그인이 필요합니다.