a xml simple (from 1292.net)(0分)

  • 主题发起人 主题发起人 xiaoboliu
  • 开始时间 开始时间
X

xiaoboliu

Unregistered / Unconfirmed
GUEST, unregistred user!
<?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>';
?>


//------------------------------------------------


<?xml version="1.0" encoding="gb2312" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<head>
<title>&amp;#65421;?&amp;#65406;&amp;#65431;&amp;#65418;&amp;#65409;&amp;#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">&amp;#65421;?&amp;#65406;&amp;#65431;&amp;#65418;&amp;#65409;&amp;#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%">&amp;#65411;﨤&amp;#65414;</td>
<td width="16%">&amp;#65397;羹?&amp;#65418;</td>
<td width="54%">&amp;#65404;?&amp;#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()">&amp;#65401;&amp;#65432;&amp;#65393;&amp;#65429;&amp;#65393;&amp;#65406;&amp;#65396;&amp;#65392;&amp;#65407;&amp;#65434;</a> </p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
 
现在不会,不过看样子可以收起来以后看的。
 
现在还看不大懂,哎
 
后退
顶部