易截截图软件、单文件、免安装、纯绿色、仅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{


相关文档:

linux下apache+php安装常见问题


configure: error: Unable to find libgd.(a|so)
如果使用的是ubuntu或debian就很简单了,直接sudo apt-get install apache2
libapache2-mod-php5 php5 php5-gd 就基本上搞定,但是用源代码安装还是很麻烦~
wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz
tar zxvf gd-2.0.11.tar.gz
cd gd-2.0.11
sudo . ......

php中使用com组件出现"拒绝访问"的处理


代码如下,
// 建立一个指向新COM组件的索引
$word = new COM("word.application") or die("Can't start Word!");
// 显示目前正在使用的Word的版本号
echo "Loading Word, v. {$word->Version}
";
exit;
?>
有时候你会得到一个错误,
PHP Fatal error: Uncaught except ......

PHP 在线聊天系统的实现

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

PHP统计网站访问次数防刷新

<?
@session_start();
$counter = intval(file_get_contents("counter.dat"));
if(!$_SESSION['jingyun'])
{
$_SESSION['jingyun'] = true;
$counter++;
$fp = fopen("counter.dat","w");
fwrite($fp, $counter);
fclose($fp);
}
?>
总访问 <span style="font-size:14px; color:#FF6600" mce_sty ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号