php第十七节课
分页查询
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<?php
//取提交的name值
$name = "";
$fytj = "";
if(!empty($_GET["name"]))
{
$name = $_GET["name"];
//分页查询条件
$fytj = "name={$name}";
}
//将name做为条件
$tj = " where AreaName like '%{$name}%' ";
?>
<br />
<div>
<form action="test.php" method="get">
<div>请输入名称:
<input type="text" name="name" value="<?php echo $name ?>" />
<input type="submit" value="查询" />
</div>
</form>
</div>
<br />
<table width="100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<td>代号</td>
<td>名称</td>
<td>父级代号</td>
</tr>
<?php
include("DBDA.php");
include("page.class.php");
$db = new DBDA();
//查询总记录数
$sqlall = "select count(*) from ChinaStates".$tj;
$attrall = $db->Query($sqlall);
$total = $attrall[0][0];
$page = new Page($total,15,$fytj,true);
$sql = "select * from ChinaStates ".$tj.$page->limit;
$attr = $db->Query($sql);
foreach($attr as $v)
{
echo "<tr><td>{$v[0]}</td><td>{$v[1]}</td><td>{$v[2]}</td></tr>";
}
?>
</table>
<div>
<?php
echo $page->fpage();
?>
</div>
</body>
</html>
php第十七节课的更多相关文章
- centos shell编程3【告警系统】 没有服务器端和客户端的概念 main.sh mon.conf load.sh 502.sh mail.php mail.sh disk.sh 第三十七节课
centos shell编程3[告警系统] 没有服务器端和客户端的概念 main.sh mon.conf load.sh 502.sh mail.php mail.sh disk.sh 第三十七 ...
- centos samba/squid 配置 samba配置 smbclient mount fstab自动挂载samba curl -xlocalhost:3128 www.qq.com squid配置 3128 DNSPOD 第二十七节课
centos samba/squid 配置 samba配置 smbclient mount fstab自动挂载samba curl -xlocalhost:3128 www.qq.com squ ...
- centos linux 系统日常管理4 scp,rsync,md5sum,sha1sum,strace ,find Rsync 常见错误及解决方法 第十七节课
centos linux 系统日常管理4 scp,rsync,md5sum,sha1sum,strace ,find Rsync 常见错误及解决方法 第十七节课 rsync可以增量同步,scp不行 ...
- 风炫安全web安全学习第三十七节课 15种上传漏洞讲解(二)
风炫安全web安全学习第三十七节课 15种上传漏洞讲解(二) 05后缀名黑名单校验之上传.htaccess绕过 还是使用黑名单,禁止上传所有web容器能解析的脚本文件的后缀 $is_upload = ...
- 风炫安全WEB安全学习第二十七节课 XSS的防御措施
风炫安全WEB安全学习第二十七节课 XSS的防御措施 XSS防御措施 总的原则 控制好输入/输出 过滤:根据业务需求进行过滤,对email,手机号码这样的输入框进行验证. 转义:所有输出到前端的数据都 ...
- 风炫安全WEB安全学习第十七节课 使用Sqlmap自动化注入(一)
风炫安全WEB安全学习第十七节课 使用Sqlmap自动化注入(一) sqlmap的使用 sqlmap 是一个开源渗透测试工具,它可以自动检测和利用 SQL 注入漏洞并接管数据库服务器.它具有强大的检测 ...
- 《linux就该这么学》第十七节课:第18,19,23章,mariadb数据库、PXE无人值守安装系统和openldap目录服务。
第23章 (借鉴请改动) openldap数据的特点:1.短小.2.读取次数较多 上述说明: openLDAP服务端配置: 1.yum install -y openldap openldap ...
- php第二十七节课
注册审核 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3 ...
- centos linux安全和调优 第四十一节课
centos linux安全和调优 第四十一节课 上半节课 Linux安全 下半节课 Linux调优 2015-07-01linux安全和调优 [复制链接]--http://www.apele ...
随机推荐
- 暴力解hdu4930Fighting the Landlords
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> us ...
- 进销存管理系统, 刚学C++
各位大神们.有什么补充的能够评论一下吗? #include<iostream> #include<string> using namespace std; int G=0;// ...
- 【Eclipse提高开发速度-插件篇】安装VJET插件,JS等提示开发插件
1.安装Apache Batik CSS 一般安装VJET插件会出现 Cannot complete the install because one or more required items co ...
- VCL源码修改立即生效
为了深刻学习Delphi的VCL源码,要使的它立刻修改生效.网上很多办法,这招最简单最管用: 把source\vcl路径添加进来,只要有修改vcl源程序,都会重新编译.但是对RTL源码不能这样做. - ...
- uefi bios安装ubuntu16.04 (win10和ubuntu双系统)
哎呀,没事闲的装双系统,按照晚上的教程装半天也没成功,后来才知道是自己电脑的问题,当然也有那些过时的博客的问题! ultraiso制作ubuntu u盘启动盘 http://www.cr173.co ...
- tiny4412 裸机程序 六、重定位代码到IRAM+0x8000【转】
本文转载自:http://blog.csdn.net/eshing/article/details/37115697 一.重定向 对于程序而言,我们需要理解两个概念,一是程序当前所处的地址,即程序在运 ...
- kentico11 教程,
create master page with css list menu Add the navigation menu Add a dynamic web part that will repre ...
- The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
EventLog.SourceExists https://stackoverflow.com/questions/9564420/the-source-was-not-found-but-some- ...
- git ldap
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md ldap : enabled : true host : 'ope ...
- 如何用css约束一个层不可见
两种方式: 方式一:设置属性值为none不可见:display:none 这个属性改变了一个元素的显示效果.之前我有提到一点,假如元素使用了none值,那么元素直接干净利落的消失不见.你在右键审查元素 ...