易截截图软件、单文件、免安装、纯绿色、仅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是一种易于学习和使用的服务器端脚本语言。只需要很少的编程知识你就能使用PHP建立一个真正交互的WEB站点。本教程并不想让你完全了解这种语言,只是能使你尽快加入开发动态web站点的行列。我假定你有一些HTML(或者HTML编辑器)的基本知识和一些编程思想。 
1.简介
  PHP是能让你生成动态网页的工 ......

PHP生成随机字符串的方法

Code:
<?php
function genRandomString($len)
{
$chars = array(
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", 
"l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", 
"w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", 
"H", "I", "J", "K", "L", "M", "N", "O", ......

php的simpletest框架对uchome项目进行接口测试脚本

<?php
require_once ('unit_tester.php');
require_once ('reporter.php');
require_once ('../config.php');
require_once ('../source\modules\user\user_api.func.php');
require_once ('../source/base_model.class.php');
Class registertest extends UnitTestCase{
public function testAssertEqual(){
$b ......

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中pear安装出现错误

      最近想安装PEAR(PHP Extension and Application Repository),但是在执行批处理文件go-pear.bat的时候出现了错误:
phar "C:\php\PEAR\go-pear.phar" does not have a signature
PHP Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: phar error: ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号