YPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.***w3.org/TR/REC-html40/loose.dtd">
smarty的设置
;/********
[database]
hostname = localhost
username = root
password = 123456
dbname = tbb
[html]
web_path =
caching = false
compile_check = true
cache_dir = /smarty_file/cache
compile_dir = /smarty_file/compile
template_dir = /smarty_file/template
;*/
;?>
index.htm
http://www.*w**3.org/1999/xhtml">
| {{$item.name}}: | {{$item.content}} |
|
一共有{{$pages}}页 {{$total}}条数据 每页显示{{$rows}}条 {{foreach from = $links item = num}} {{if $num == $current_page}} {{$num}} {{else}} {{/if}} {{/foreach}} |
|
下面是显示程序
define('ROOT_PATH', dirname(__FILE__));
require_once ROOT_PATH . '/lib/m_html.class.php';
require_once ROOT_PATH . '/lib/m_db.class.php';
$page = $_GET['page'];
$mdb = new m_db();
$html = new m_html('/test_' . $page . '.html', 30);
$num = $mdb->fetch_one('select count(*) as num from test');
$page_arr = $mdb->page($num['num'], $page, 7, 4);
$rs = $mdb->fetch_all('select * from test order by id desc limit ' . $page_arr['start'] . ',' . $page_arr['rows']);
$html->assign('rs', $rs);
$html->assign('web_path', $html->config['web_path'] . '/');
$html->assign($page_arr);
$html->render('index.htm', '/test_' . $page_arr['current_page'] . '.html');
?>
下面是保存留言代码
define('ROOT_PATH', dirname(__FILE__));
require_once ROOT_PATH . '/lib/m_db.class.php';
require_once ROOT_PATH . '/lib/m_string.class.php';
$_POST = m_string::addslashes($_POST);
$mdb = new m_db();
$mdb->add('test', array('name', 'content'), array($_POST['username'], $_POST['content']));
header('location:test.php');
?>
CREATE TABLE `test` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
`content` tinytext NOT NULL,
PRIMARY KEY (`id`)
)
罚罪1+2全80集阿里云盘全集资源链接-罚罪1+2全集高清1080P/4K阿里云盘资源下载无删减
邵氏精品禁品未删减资源在线看-必看的50部邵氏电影无删减观看入口
羞羞漫画高清最新资源-正规平台免费入口与无删减资源导航
日漫入口-官方认证安全入口与无删减日漫资源直达导航
一拳超人漫画入口-2026最新免费高清全集在线看
杨紫《生命树》1080p全40集迅雷磁力链接分享-杨紫《生命树》40集高清完整版迅雷云盘下载1080P(4k)资源