apple_lucky
(apple_lucky)
新手上路

一般会员
UID 28831
精华
0
积分 49
帖子 49
金钱 49 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2004-5-25
状态 离线
|
[推荐阅读] 怎样返回上一页!
<head>
<meta http-equiv="Content-Type" content="text/html; charset=??????">
<title>动态显示新闻</title>
</head>
<body background="D:\AppServ\www\appserv\023.gif">
<?
//建立与数据库服务器的连接
$cn=@mysql_connect('localhost','root','')
or die("不能连接数据库服务器");
//每页显示10行
$pagesize=10;
//定义SQL语句,该语句按编号的递减次序从news表中选出所有新闻
$strSQL="select * from news order by NID desc";
//发送strSQL语句
$result=@mysql_db_query("ls_news",$strSQL,$cn);
?>
<table border="0" cellpadding="3" cellspacing="0" width="50%" height="100">
<tbody><tr><td align="left" valign="top" width="30%" height="71">
<table border="0" width="100%" height="150">
<tr><td width="100%" height="14"><p align="center">
<font color="#FF0000">国际新闻</font></td></tr>
</table>
</td>
<?
//循环显示每条新闻
while ($arr=@mysql_fetch_array($result)){
if($arr[ispic]==1){
echo "<tr><td width='100%' height='160'><p>"."<img src='.\\pic\\$arr[picfile]' width='135' height='120'>"."</p><p><a href='disp.php?NID=$arr[NID]'>".$arr[title]."</a></p></td></tr>";
}
}
?>
<td valign="top" width="70%" height="100">
<table border="0" width="100%" height="70">
<tr><td width="100%" height="17" valign="top">
<p align="center"><font color="#FF0000">热点新闻</font></td></tr></tr>
<td width="100%" height="176" valign="top">
<?
//移回第一条新闻处
//循环显示每条热点新闻
@mysql_data_seek($result,0);
while ($arr=@mysql_fetch_array($result))
{
if($arr[ishot]==1)
{
echo "<font color='#FF0000'>".
"<img border='0' src='.\image\ball.gif'".
"width='15' height='15'></font>".
"<a href='disp.php?NID=$arr[NID]'></a>".
$arr[title]."</a><font color='red' size='1'>(".
$arr[newsdate].")</font><br>";
}
}
?>
<tr><td width="100%" height="18">
<div align="right">
<table border="2" width="90" cellspacing="0">
<tr><td width="100%"><p align="center">
<a href="others.php"><font color="#FF0000">更多新闻</font></a>
</td></tr></table>
</div></td></tr>
</body>
<?php
//关闭连接
mysql_close($cn);
?>
<html>
|
|