|

- Web 2.0. II. RSS- .

- , - , . , , - , . (, ), , , . , rss- , , , rss-.

rss- 2.0. , RSS.


1. .

MySQL "news". (author), (date), (title) - (text). 5 , , .

2. .

PHP ( , HTML- ).

:

<?php
header('Content-type: application/xml');
// .
$data="<?xml version=\"1.0\" encoding=\"windows-1251\" ?> ";
$data.= "<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">";
$data.= "<channel>";
$data.= "<title> </title>";
$data.= "<link>URL- </link>";
$data.= "<description> </description>";
$data.= "<copyright> </copyright>";
$data.= "<language>ru</language>";
$data.= "<managingEditor> </managingEditor>";
$data.= "<webMaster> -</webMaster>";

( MySQL):

$link = mysql_connect ("localhost", "username", "password") or die(" ");
mysql_select_db("db_name", $link);

:

$query="SELECT * FROM news ORDER BY id DESC";
$result = mysql_query($query, $link);

20 , , RSS:

for ($i=1; $i<20; $i++)
{
$row = mysql_fetch_array($result);
$date = $row['date'];
$title = $row['title'];
$text = $row['text'];
$author = $row['text'];

:

$data.="<item>";
$data.="<title>".$title."</title>";
$data.="<link> </link>";
$data.="<description>".$text."</description>";
$data.="<dc:creator> </dc:creator>";
$data.="<dc:date>".$date."</dc:date>\n</item>";
}

mysql_close($link);

$data=$data."</channel></rss>";

print($data);

RSS- , . , , - , rss-, ( WriteRssPhp 1.0 - RSS ) , (ReaderRssPhp 1.0 - RSS ).
  - Photoshop,  ,