PHP简单分页
<?php
//改变数据库名之后即可使用的分页
include 'conn.php'; //这里添加一个数据库连接即可,变换成自己设定的链接
$page=$_GET['page']; //翻页选项 首页,下一页,上一页,尾页
$current= $_GET['current']; //当前页数
mysql_select_db("leaveword");//使用的数据名
$result=mysql_query("select * from msgs",$connection);//改变数据
$total=mysql_num_rows($result);
$pagesize=3;
if (($total%$pagesize)!=0)
$totalpage=intval($total/$pagesize)+1;
else
$totalpage=intval($total/$pagesize);
if ($page=="")
相关文档:
php中substr的用法详解
php.net中关于substr的说明很简单:
start
If start is non-negative, the returned string will start at the start 'th position in string , counting from zero. For instance, in the string 'abcdef', the character at position 0 is 'a', the character at position 2 is 'c', and so for ......
在网站设计中我们经常会遇到需要多语言支持的情况。多语言系统按照支持的方式一般可分为两种:
1.支持多语言,但不支持多种语言的同时存在,也就是说要么是中文要么是英文或者其他,这在一些需要国际化支持的网页系统中经常用来,以便方便用户本地化。 2.支持多语言并可同时浏览不同语言版本的网页。今天我想讨 ......
文件check.php
<?php
//生成验证码图片
Header("Content-type: image/PNG");
srand((double)microtime()*1000000);//播下一个生成随机数字的种子,以方便下面随机数生成的使用
session_start();//将随机数存入session中
$_SESSION['authnum']="";
$im = imagecreate(62,20); //制定图片背景大小
$black = ImageC ......
<?php
error_reporting(0);//7all,0no
ini_set('display_errors', '0');
function myerror($errno, $errstr, $errfile, $errline)
{
echo "<BR>error type: [$errno] $errstr<br />\n";
echo "in line $errline of file $errfile<BR>";
} ......
<?php
class useful{
/*
* 常用函数类
* 作 者:多菜鸟
* 联系邮箱:kingerq AT msn DOT com
* 创建时间:2005-07-18
* 来源:http://blog.csdn.net/kingerq
*/
/*
* 功能:格式化数字,以标准MONEY格式输出
......