묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
트랙백 기능에 관해서
2006.10.05 01:11
http://ilikekjw.namoa.net/trackback.php제로보드에 쓴 글을 다른 블로그로 트랙백보내고싶어서-_- ;
링크된 곳과 같은 페이지를 만들었는데요 ;;
태터 0.x 버전에는 보내지는데
태터 1.0이후나 네이버블로그 등에는 안보내지네요a;;
어떻게하면 되는지 아시는분 없나요 ??;;
아래는 위쪽 사이트 소스입니다~
-----------
<?
function send_packet($url, $data) {
$uinfo = parse_url($url);
echo $uinfo[query]."n".$uinfo[host]."n".$uinfo[port]."n".$uinfo[path]."n";
if ($uinfo[query]) $data .= "&".$uinfo[query];
if (!$fp = @fsockopen ($uinfo[host], (($uinfo[port])?($uinfo[port]):("80")), $errno, $errstr, 3)) return false;
fputs ($fp, "POST ".$uinfo[path]." HTTP/1.1rn");
fputs ($fp, "Host: ".$uinfo[host]."rn");
fputs ($fp, "Content-type: application/x-www-form-urlencodedrn");
fputs ($fp, "Content-length: ".strlen($data)."rn");
fputs ($fp, "Connection: closernrn");
fputs ($fp, $data);
while(!feof($fp)) $http_response .= fgets($fp, 128);
@fclose($fp);
list($http_headers, $http_content) = explode("rnrn", $http_response);
return $http_response;
}
if($mode=="send") {
$title=str_replace("\'","'",$title);
$title=str_replace("\"",""",$title);
$data ="url=".$url."&title=".$title."&blog_name=".$blog_name."&excerpt=".$excerpt;
$result = send_packet($server,$data);
if (strpos($result, "error>1</error")) $alert = "전송을 실패했습니다.";
else {
$alert = "전송을 완료했습니다.";
}
?>
<script type="text/javascript">
alert('<?=$alert?>');
</script>
<?
echo $result;
exit;
}
?>
<html>
<head>
<title>트랙백 보내기</title>
</head>
<body>
<form method=post name=mainform>
<input type=hidden name=mode value=send>
<table>
<tr><td>트랙백 주소</td><td><input type=text size=80 name=server></td></tr>
<tr><td>주소</td><td><input type=text size=80 name=url></td></tr>
<tr><td>제목</td><td><input type=text size=80 name=title></td></tr>
<tr><td>블로그명</td><td><input type=text size=80 name=blog_name value=""></tr>
<tr><td>내용</td><td><input type=text size=80 name=excerpt></tr>
<tr><td colspan=2 align=center><br><input type=submit value="보내기"></td></tr>
</table>
</form>
링크된 곳과 같은 페이지를 만들었는데요 ;;
태터 0.x 버전에는 보내지는데
태터 1.0이후나 네이버블로그 등에는 안보내지네요a;;
어떻게하면 되는지 아시는분 없나요 ??;;
아래는 위쪽 사이트 소스입니다~
-----------
<?
function send_packet($url, $data) {
$uinfo = parse_url($url);
echo $uinfo[query]."n".$uinfo[host]."n".$uinfo[port]."n".$uinfo[path]."n";
if ($uinfo[query]) $data .= "&".$uinfo[query];
if (!$fp = @fsockopen ($uinfo[host], (($uinfo[port])?($uinfo[port]):("80")), $errno, $errstr, 3)) return false;
fputs ($fp, "POST ".$uinfo[path]." HTTP/1.1rn");
fputs ($fp, "Host: ".$uinfo[host]."rn");
fputs ($fp, "Content-type: application/x-www-form-urlencodedrn");
fputs ($fp, "Content-length: ".strlen($data)."rn");
fputs ($fp, "Connection: closernrn");
fputs ($fp, $data);
while(!feof($fp)) $http_response .= fgets($fp, 128);
@fclose($fp);
list($http_headers, $http_content) = explode("rnrn", $http_response);
return $http_response;
}
if($mode=="send") {
$title=str_replace("\'","'",$title);
$title=str_replace("\"",""",$title);
$data ="url=".$url."&title=".$title."&blog_name=".$blog_name."&excerpt=".$excerpt;
$result = send_packet($server,$data);
if (strpos($result, "error>1</error")) $alert = "전송을 실패했습니다.";
else {
$alert = "전송을 완료했습니다.";
}
?>
<script type="text/javascript">
alert('<?=$alert?>');
</script>
<?
echo $result;
exit;
}
?>
<html>
<head>
<title>트랙백 보내기</title>
</head>
<body>
<form method=post name=mainform>
<input type=hidden name=mode value=send>
<table>
<tr><td>트랙백 주소</td><td><input type=text size=80 name=server></td></tr>
<tr><td>주소</td><td><input type=text size=80 name=url></td></tr>
<tr><td>제목</td><td><input type=text size=80 name=title></td></tr>
<tr><td>블로그명</td><td><input type=text size=80 name=blog_name value=""></tr>
<tr><td>내용</td><td><input type=text size=80 name=excerpt></tr>
<tr><td colspan=2 align=center><br><input type=submit value="보내기"></td></tr>
</table>
</form>