i have a simple use php
//create a xml file
<?php require('../dbconnect.php');
if(empty($page))
{$page=1;
}
if(empty($order))
{$order='hot';
}
if(empty($sortid))
{$order='1';
}
$startrecord=($page-1)*12;
switch($order)
{
case 'hot':
$querystring="select * from urlstable order by click desc LIMIT $startrecord,12";
break;
case 'new':
$querystring="select * from urlstable order by getday desc LIMIT $startrecord,12";
break;
case 'sort':
$querystring="select * from urlstable where sort=$sortid order by click desc LIMIT $startrecord,12";
break;
default :
$querystring="select * from urlstable order by click desc LIMIT $startrecord,12";
break;
}
$result=mysql_query($querystring,$db);
echo '<?xml version="1.0" encoding="gb2312"?>';
echo '<?xml-stylesheet type="text/xsl" href="sitelist.xsl"?>';
echo '<URL>';
while ($data=mysql_fetch_array($result))
{ echo '<WEBSITE ID="'.$data["id"].'">';
echo '<NAME>'.$data["name"].'</NAME>';
echo '<LINK>'.$data["link"].'</LINK>';
echo '<CLICK>'.$data["click"].'</CLICK>';
echo '<DATE>'.$data["getday"].'</DATE>';
echo '<BRIEF>'.$data["brief"].'</BRIEF>';
echo '</WEBSITE>';
}
echo '</URL>';
?>
//create xsl file
<?xml version="1.0" encoding="gb2312" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<head>
<title>&#65421;?&#65406;&#65431;&#65418;&#65409;&#65423;</title>
<meta http-equiv="Content-Type" content="text/html;
charset=gb2312" />
<link rel="stylesheet" href="../1292.css" type="text/css" />
</head>
<body>
<p align="center"><font size="3">&#65421;?&#65406;&#65431;&#65418;&#65409;&#65423;</font></p>
<table width="90%" border="0" cellspacing="1" bgcolor="#000000" align="center">
<tr>
<td bgcolor="#FFFFFF" valign="top" >
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr bgcolor="#CCCCCC">
<td height="20" align="right">
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="30%">&#65411;﨤&#65414;</td>
<td width="16%">&#65397;羹?&#65418;</td>
<td width="54%">&#65404;?&#12539;/td>
</tr>
<xsl:for-each select="URL/*">
<tr>
<td width="30%">
<a><xsl:attribute name="href">go.php?id=<xsl:value-of select="@ID"/></xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute><xsl:value-of select="NAME"/></a>
</td>
<td width="16%"><xsl:value-of select="CLICK"/></td>
<td width="54%"><xsl:value-of select="BRIEF"/></td>
</tr>
</xsl:for-each>
</table>
</td>
</tr>
</table>
<p align="center"> <a href="#" onclick="window.close()">&#65401;&#65432;&#65393;&#65429;&#65393;&#65406;&#65396;&#65392;&#65407;&#65434;</a> </p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>