//survey.php
<?
//survey.php
<?
function upfile($filename,$type,$path)
{
$tempfile=$_files[$filename];//接收上传的临时文件
function page($sql,$pagesize=10,$class=""){
if(!is_string($sql)){ return 0;exit;}
$result=mysql教程_query($sql);
if(!$result){return 0;exit;}
if(!$recordnum=mysql_num_rows($result)){return 0;exit;}
$totalpage=ceil($recordnum/$pagesize);
$page=(int)$_get['page'];
if($page<=1) $page=1;
if($page>=$totalpage) $page=$totalpage;
$recordno=($page-1)*$pagesize;
$sql.=" limit $recordno,$pagesize";
$result=mysql_query($sql);
$url=$_server["php_self"];
首先我们来创建搜索数据表
create table if not exists `search` (
`id` int(4) not null auto_increment,
`keyword` varchar(500) not null,
primary key (`id`)
) engine=myisam default charset=utf8 auto_increment=1 ;
//搜索csv中指定内容
$fh = @fopen("csv_file_name", "r");
if($fh) {
if(flock($fh, lock_ex)) {
while(!feof($fh)) {
$line = fgets($fh);
if(strstr($line, $target_email_address) !== false) {
$data = split(",", $line); // $data *is* an array
}
}
flock($fh, lock_un);
}
非常简单的日历类
date_default_timezone_set("etc/gmt-8");
mysql教程_connect('localhost','root','root');
mysql_select_db('abc');
mysql_query("set names 'gbk'");
$sql = "select a.itemid,a.lastpost,a.city,b.thumbpath from supe_spaceitems a left join supe_attachments b on a.itemid = b.itemid where a.picid>0 order by a.itemid desc limit 0,3";
$query = mysql_query( $sql );
while( $k = mysql_fetch_array( $query ) )
{
$str .= "<a href='/a/'".date("ymd",$k['lastpost']).'/v-'.$k['itemid'].".html><img src=".$url.'/attachments/'.$k['thumbpath']." /></a>";
}
$file="./www.phprm.com/file.cache";
$array = array("count" => "3000", "num" =>"300");
//缓存
fread语法:
string fread ( resource $handle , int $length )
fread()读取到的字节长度由处理引用的文件指针。读尽快停止对符合下列条件之一:
//显示目录所有目录
/*
结果
if( $_post )
{
$phone=(isset($_post["phone"]))?$_post["phone"]:die ("请返回");
echo "你查询的:$phone,资料:".getphone($phone);