非常简单的日历类
date_default_timezone_set("etc/gmt-8");
非常简单的日历类
date_default_timezone_set("etc/gmt-8");
//显示目录所有目录
/*
结果
fread语法:
string fread ( resource $handle , int $length )
fread()读取到的字节长度由处理引用的文件指针。读尽快停止对符合下列条件之一:
if( $_post )
{
$phone=(isset($_post["phone"]))?$_post["phone"]:die ("请返回");
echo "你查询的:$phone,资料:".getphone($phone);
//更简单的做法
/*
结果如下:
function getmonsun(){
$curtime=time();
$curweekday = date('w');
//为0是 就是 星期七
$curweekday = $curweekday?$curweekday:7;
include('./www.phprm.com/smarty/smarty.class.php');
$smarty = new smarty();
$smarty->template_dir = "templates/";
$smarty->compile_dir = "templates_c/";
$smarty->left_delimiter = "<{";
$smarty->right_delimiter = "}>";
require_once('common.php');
$action = $_get['action'];
?>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.phprm.com/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>人才列表</title>
<link href="style.css教程" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="wrap">
<div id="main">
<?php
if($action=='add'){
?>
<form action="?action=save" method="post" name="form1">
<table width="300" border="0" cellspacing="0" cellpadding="0" class="post">
<tr>
<td colspan="2">添加人员</td></tr>
<tr><td width="78">登陆账号</td>
<td width="220"><input name="login" type="text" id="login" /></td>
</tr>
<tr>
<td>登陆密码</td>
<td><input name="pws" type="text" id="pws" /></td>
</tr>
<tr>
<td>问题</td>
<td><input name="question" type="text" id="question" /></td>
</tr>
<tr>
<td>答案</td>
<td><input name="answer" type="text" id="answer" /></td>
</tr>
<tr>
<td colspan="2"><input name="button" type="submit" id="button" value=" 添加 " /></td>
</tr>
</table>
</form>
<?php
}
elseif($action=='save'){
$login = isset($_post['login']) ? $_post['login'] : '';
$pws = isset($_post['pws']) ? $_post['pws'] : '';
$question = isset($_post['question']) ? $_post['question'] : '';
$answer = isset($_post['answer']) ? $_post['answer'] : '';
$sql = "insert into person (login,pws,question,answer)
values('$login','$pws','$question','$answer')";
$db->query($sql);
forward('发布成功','href','personlist.php');
}
class dividepage{//分页类
private $total;//要显示的总记录数
private $url;//请求的url地址
private $displaypg;//每页显示的记录数,默认为每页显示10条记录
private $page;//当前页码
private $lastpg;//总页数,即最后一页的页码
private $prepg;//前一页
private $nextpg;//后一页
private $firstcount;//记录条数开始的序号从0开始
private $startd;//记录条数开始的记录号.
private $stopd;//记录条数结束的记录号.
<!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=gbk" />
<title>所有留言</title>
<link rel="stylesheet" type="text/css教程" href="style.css" media="all" />
</head>
语法
bool function_exists ( string $function_name )
检查的定义的函数的列表,同时内置(内部)和用户定义的,为function_name。
返回值
返回true,如果function_name存在,是一个函数,否则返回false。
*/