무슨 일이 일어나고 있는지 이해하지 못하고 몇 달 동안 사이트를 변경하지 않았지만 갑자기 RSS 피드가 더 이상 작동하지 않습니다.맞춤 RSS 피드가 갑자기 더 이상 작동하지 않습니다.
는 다음 코드와 PHP 파일을 만듭니다
header('Content-type: text/xml');
include("config/config.inc.php");
$result = mysqli_query($link, "SELECT * FROM tutorials ORDER BY tutorial_id DESC LIMIT 50");
?>
<rss version="2.0">
<channel>
<title>CMS tutorial site</title>
<description>Bringing you the best CMS tutorials from the web</description>
<link>http://cmstutorials.org</link>
<?php
while($row = mysqli_fetch_object($result))
{
$user = mysqli_fetch_object(mysqli_query($link, "SELECT * FROM user_extra WHERE userid=".$row->user_id.""));
?>
<item>
<title><?php echo $row->title; ?></title>
<author><?php echo $user->username; ?></author>
<description><?php echo $row->description; ?></description>
<pubDate><?php echo $row->date; ?></pubDate>
<link>http://cmstutorials.org/view_tutorial.php?tutorial_id=<?php echo $row->tutorial_id; ?></link>
</item>
<?php
}
?>
</channel>
</rss>
나는 phpMyAdmin에 그것을 실행하여 쿼리를 확인하고이 오류를 제공하지 않습니다 작동합니다. 내가 헤더 콘텐츠 형식을 삭제하고 RSS 태그를 할 때이 http://cmstutorials.org/rss (또는 http://cmstutorials.org/rss.php)
아니요, 유효한 UTF-8이 아닙니다. 적어도 하나의 문자가 손상되었습니다. 게다가, XML 출력에서'htmlentities'를 절대 사용하지 마십시오. 일반 UTF-8 문자를 사용하거나 CDATA 태그의 데이터를 래핑하십시오. –
팁 주셔서 감사합니다. 현재 사이트를 codeigniter 프레임 워크로 변환하려고합니다.이 모든 것이 수정되어야합니다. Pekka가 임시 수정으로 권장하지 않는다고하더라도 위의 코드를 사용했습니다. – Christophe