在你的登陆面里。PHP跟数据库连接。新闻要放在那里。做一个程序。一就你所想要的面读取数据库里的新闻。对于新闻的更新。可以再写一个后台程序。来管理新闻,对其进行增删改。
解决方案 »
- "UPDATE XXX SET YYY=YYY-1" 当YYY为0 的问题
- MYSQL 存储过程返回多数据集合。
- 新出炉的MySQL备份方案
- VC6.0和PostgreSQL连接问题(ADO数据库访问技术)
- (求助)MYSQL ERROR 2006
- mysql 去掉字段中的中文
- 请教类\子类的表如何设置最好?
- 我在http://www.mysql.com 下载了一个mysql3。23。42,以前很好用,可是现在不好使了
- mysql不用子查询实现添加列,求脚本大神助!
- 安装phpmyadmin以后,提示 PHP MySQL 库版本 5.1.59 和你的 MySQL 服务器版本 5.5.38 不同
- 急救!!!MYSQL导入导出??
- Another quetion .Why my mysql server(On Linux) allways shutdown when i start it?
自动显示数据库内容就更简单了,打开新页面或者是刷新页面时从数据库里调用,然后echo出来就可以了吧?不明白?说具体的吧……我也不是很明白你的问题……不过,我等分:)
so, in main.php,
first:
validate session by $_GET['sessionid'] and check out the user's id.
or by checking cookie if u prefer..second:
if($_GET['type']=="news" && $_GET['newsid']>0)
{
check whether the news of the id is available in ur table.
if no, return an error msg
if yes
{
insert a record including user_id, news_id, timestamp and so on
return the page with the selected news
}
}
else
{
return the page with the ten recent news..
}with best wishessandy