首页 > php代码

一款简单的php 文件上传源码

$type=filekzm($_files["filedata"]["name"]);
if ((($type == ".gif")
|| ($type == ".png")
|| ($type == ".jpeg")
|| ($type == ".jpg")
|| ($type == ".bmp"))
&& ($_files["filedata"]["size"] < 200000))
  {
  if ($_files["filedata"]["error"] > 0)
    {
    echo "返回错误: " . $_files["filedata"]["error"] . "<br />";
    }
  else
    {
    echo "上传的文件: " . $_files["filedata"]["name"] . "<br />";
    echo "文件类型: " . $type . "<br />";
    echo "文件大小: " . ($_files["filedata"]["size"] / 1024) . " kb<br />";
    echo "临时文件: " . $_files["filedata"]["tmp_name"] . "<br />";

阅读全文

二款php mysql 分页代码

本文章提供两种mysql分页代码,分页原是都很简单就是$total = @(int)($sum / $pagesize);$p = (int)$_GET['page'];再到数据库中支limti X,X就成了。  代码如下 复制代码 function fenyezhixin($table,$pagesize="",$paixu="",$do="",$wwhere=""){    if(($table == "ne...
阅读全文

php mysql 分页函数

+-----------------------------------------------------------------------
| 文件概要:分页显示函数
| 文件名称:page.php
| 创建时间:2010-5-20
+-----------------------------------------------------------------------
*/
 function _pageft($totle, $displaypg = 20, http://pic4.phprm.com/2010/10/26/$url.jpg = '') {

阅读全文

php 目录列出所有文件

 在php中有很多方法来把目录所有文件列出的代码,用e
*/

$list = scandir(".");
    $zipname = "";
    foreach($list as $file)
    {
      if($file=="."||$file=="..")continue;
      $b=substr($file,-3);
      if($b==".gz"||$b==".fz")
      { $zipname = $file; break; }
    }
 
//代码二

阅读全文

js 树形菜单(php ajax可刷新)

<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.phprm.com/tr/xhtml1/dtd/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>simpletree drag</title>
<style>
body
{
 font: normal 12px arial, tahoma, helvetica, sans-serif;
 margin:0;
 padding:20px;
}
.simpletree
{
 
 margin:0;
 padding:0;
 /*
 overflow:auto;
 width: 250px;
 height:350px;
 overflow:auto;
 border: 1px solid #444444;
 */
}
.simpletree li
{
 list-style: none;
 margin:0;
 padding:0 0 0 34px;
 line-height: 14px;
}
.simpletree li span
{
 display:inline;
 clear: left;
 white-space: nowrap;
}
.simpletree ul
{
 margin:0;
 padding:0;
}
.simpletree .root
{
 margin-left:-16px;
 background: url(http://pic3.phprm.com/2010/10/16/root.jpg) no-repeat 16px 0 #ffffff;
}
.simpletree .line
{
 margin:0 0 0 -16px;
 padding:0;
 line-height: 3px;
 height:3px;
 font-size:3px;
 background: url(http://pic3.phprm.com/2010/10/16/line_bg.jpg) 0 0 no-repeat transparent;
}
.simpletree .line-last
{
 margin:0 0 0 -16px;
 padding:0;
 line-height: 3px;
 height:3px;
 font-size:3px;
 background: url(http://pic3.phprm.com/2010/10/16/spacer.jpg) 0 0 no-repeat transparent;
}
.simpletree .line-over
{
 margin:0 0 0 -16px;
 padding:0;
 line-height: 3px;
 height:3px;
 font-size:3px;
 background: url(http://pic3.phprm.com/2010/10/16/line_bg_over.jpg) 0 0 no-repeat transparent;
}
.simpletree .line-over-last
{
 margin:0 0 0 -16px;
 padding:0;
 line-height: 3px;
 height:3px;
 font-size:3px;
 background: url(http://pic3.phprm.com/2010/10/16/line_bg_over_last.jpg) 0 0 no-repeat transparent;
}
.simpletree .folder-open
{
 margin-left:-16px;
 background: url(images/collaps教程able.gif) 0 -2px no-repeat #fff;
}
.simpletree .folder-open-last
{
 margin-left:-16px;
 background: url(http://pic3.phprm.com/2010/10/16/collapsable-last.jpg) 0 -2px no-repeat #fff;
}
.simpletree .folder-close
{
 margin-left:-16px;
 background: url(http://pic3.phprm.com/2010/10/16/expandable.jpg) 0 -2px no-repeat #fff;
}
.simpletree .folder-close-last
{
 margin-left:-16px;
 background: url(http://pic3.phprm.com/2010/10/16/expandable-last.jpg) 0 -2px no-repeat #fff;
}
.simpletree .doc
{
 margin-left:-16px;
 background: url(http://pic3.phprm.com/2010/10/16/leaf.jpg) 0 -1px no-repeat #fff;
}
.simpletree .doc-last
{
 margin-left:-16px;
 background: url(http://pic3.phprm.com/2010/10/16/leaf-last.jpg) 0 -1px no-repeat #fff;
}
.simpletree .ajax
{
 background: url(http://pic3.phprm.com/2010/10/16/spinner.jpg) no-repeat 0 0 #ffffff;
 height: 16px;
 display:none;
}
.simpletree .ajax li
{
 display:none;
 margin:0;
 padding:0;
}
.simpletree .trigger
{
 display:inline;
 margin-left:-32px;
 width: 28px;
 height: 11px;
 cursor:pointer;
}
.simpletree .text
{
 cursor: default;
}
.simpletree .active
{
 cursor: default;
 background-color:#f7be77;
 padding:0px 2px;
 border: 1px dashed #444;
}
#drag_container
{
 background:#ffffffwww.phprm.com;
 color:#000;
 font: normal 11px arial, tahoma, helvetica, sans-serif;
 border: 1px dashed #767676;
}
#drag_container ul
{
 list-style: none;
 padding:0;
 margin:0;
}

阅读全文