易截截图软件、单文件、免安装、纯绿色、仅160KB

PHP分页代码

头部调用
 <?
require('conn.php');
$sql1="select id from news";
$query1=mysql_query($sql1,$conn);
$sun_num=mysql_num_rows($query1);
$gs=20;
$page_num=ceil($sun_num/$gs);
include("../subpage.php");
//传过来的页数参数
$PB_page=$_GET['PB_page'];
if ($PB_page==1 or empty($PB_page)){
$a=0;
}else{
$a=(($PB_page-1)*$gs);
}
?>
HTML部分代码
<div style="margin-top:10px;" mce_style="margin-top:10px;">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<form id="form1" name="form1" method="get" onsubmit="return checkkey()"> <tr>
<td width="9%" height="25" align="center">
<span style="color:#067098; font-weight:bold" mce_style="color:#067098; font-weight:bold">文章搜索:</span> </td>
<td width="25%" align="left"><input name="key" type="text" class="txt" id="key" size="40"/></td>
<td width="66%" align="left"><input type="submit" name="Submit" value="搜 索" /></td>
</tr>
</form>
</table>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td height="30" colspan="6" bgcolor="#FFFFFF" class="title" style="border-top:1px #B8D3E1 solid; border-bottom:1px #F7AC1B dashed" mce_style="border-top:1px #B8D3E1 solid; border-bottom:1px #F7AC1B dashed">新闻列表</td>
</tr>
<tr>
<td width="6%" height="25" align="center" bgcolor="#B5E9FF">ID</td>
<td width="63%" height="25" align="center" bgcolor="#B5E9FF">新闻标题</td>
<td width="8%" align="center" bgcolor="#B5E9FF">作者</td>
<td width="13%" align="center" bgcolor="#B5E9FF">添加时间</td>
<td colspan="2" align="center" bgcolor="#B5E9FF">操 作</td>
</tr>
<?
if (!$_GET[key]){

$sql="SELECT * from news order by id desc limit $a,$gs";
}else{


相关文档:

php 对文件操作

PHP创建文件(夹)以及目录操作
 一、目录操作
   
      首先是从目录读取的函数,opendir(),readdir(),closedir(),使用的时候是先打开文件句柄,而后迭代列出:
<?php
$base_dir="filelist/";
$fso=opendir($base_dir);
echo  $base_dir."<hr/>";
whil ......

php生成word文档,并可以下载

<?php
if($_POST['str'])
{
header('Content-type: application/doc');
header('Content-Disposition: attachment; filename="downloaded.doc"');
echo iconv("UTF-8","GB2312",$_POST['str']);
}
?>
<a href="javascript:void(0)" onclick="downword()">下载</a>
<div id="word" style="dis ......

PHP 在线聊天系统的实现

在线实时聊天系统,一直是一个比较麻烦的东西。
一般实现在线实时聊天,是利用JS在客户端使用ajax每隔一定的时间就返回服务器请求数据,如果有新的聊天信息则用JS呈现给用户
我们不说这样做的利弊,直接切入正题,如何来实现服务器推的在线聊天系统
首先,我先请大家看一个例子
复制代码
<?php
while(true){
&n ......

LAMP(Linux+Apache+Mysql+PHP)部署日志

本文记录一下本人安装LAMP的全过程
本人使用的Linux为RedHat Enterprise 5 X64
第一步:安装Mysql
Mysql的安装比较简单,为了避免出现文件找不到的情况,我依次下载安装了以下4个RPM包
MySQL-server-community-5.1.46-1.rhel5.x86_64.rpm
MySQL-client-community-5.1.46-1.rhel5.x86_64.rpm 
MySQL-devel-commu ......

小巧的php文档生成类

在项目开发中发现对php的文档缺少管理,别人写了一个,功能不多
<?php
/**
* 类名: doc
*
描述: 文档生成类
* 其他: 可以对目录进行过滤,设置好源目录后,请用绝对路径指定生成目录,模式可调,模式
*
1为常规类型,即以 斜线**开头,以*斜线 结束
* 2为扩展类型,凡是 斜线*开头以*斜线 结束的部分都将成为文 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号