织梦CMS自定义表单分页+模版显示
来源:爱站网时间:2018-02-06编辑:网友分享
这篇文章主要给大家介绍织梦CMS自定义表单分页+模版显示,很简单,需要的朋友可以参考下。
tyle="box-sizing: border-box; margin: 0px 0px 18px; word-wrap: break-word; color: rgb(85, 85, 85); font-family: 'Roboto Condensed', sans-serif; font-size: 15px; line-height: 25px;">
最近有网友找到小编,说想在前台把DEDECMS的自定义表单提交的内容显示出来并分页,在此呢,爱站技术频道的小编我就帮他写了一下。
根目录建立form.php
|
1
2
3
4
5
6
7
8
9
10
|
require_once('/include/common.inc.php');
require_once(DEDEINC.'/datalistcp.class.php');
$sql = "Select * From `dede_diyform1`";//可以接着加条件 例如order by id desc 排序
$dlist = new DataListCP();
$dlist->SetTemplet("templets/plus/form.htm");
$dlist->SetSource($sql);
$dlist->display();
?> |
form.htm 放到templets/plus目录下
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
{dede:config.pagesize value='5'/}
nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">head>
{dede:datalist}{/dede:datalist}ul>
{dede:pagelist listsize=5/}body>
html>
|
{dede:field.name /}和{dede:field.sex /} 根据你自己的自定义表单字段来填写.
例如 我的自定义表单1里就加了2个字段

后台的数据

是不是非常简单,翻页的样式自己写个CSS 就搞定了.
