PHP
文章平均质量分 64
aw3423zsddf
asdf
展开
-
icon生成类
<?php$output = "";if($_FILES['upimage']!=''){if(isset($_FILES['upimage']['tmp_name']) && $_FILES['upimage']['tmp_name'] && is_uploaded_file($_FILES['upimage']['tmp_name'])){...2010-04-14 17:40:11 · 1258 阅读 · 0 评论 -
PHP 上传函数介绍
1、FORM标签enctype属性 <form enctype="multipart/form-data" method="post" name="upform"> <input name="upfile" type="file">2、$_FILES 系统函数$_FILES['myFile']['name'] 客户端文原创 2010-02-03 21:04:01 · 118 阅读 · 0 评论 -
PHP SOCKET()方式发送邮件(附php类)
fsockopen(string hostname, int port, int [errno], string [errstr], int [timeout]); 这里由于要使用SMTP协议,所以端口号为25。在打开连接成功后,会返回一 个socket句柄,使用它就可以象使用文件句柄一样的。可使用的操作有fputs(), fgets(),feof(...原创 2010-02-03 21:48:45 · 90 阅读 · 0 评论 -
PHP 通用分页类PagerBox及使用
<?php//使用实例//$totalNum = 101; //总数(数据记录总数)//$page = isset ( $_GET ['page'] ) ? $_GET ['page'] : 1; //当前页数//$perPage = 10; //每页显示记录//$url = $_SERVER['PHP_SELF'];////$length = 5;//每页显示步长...原创 2010-02-04 21:36:22 · 172 阅读 · 0 评论 -
smarty 基本配置、应用
//以下为:smart_inc.php include_once("Smarty/Smarty.class.php"); //包含smarty类文件 压缩包中的libs文件夹中$smarty = new Smarty(); //建立smarty实例对象$smarty$smarty->config_dir="Smarty/Config_File.class.php"; //...2010-02-23 21:40:52 · 159 阅读 · 0 评论 -
jquery 操作复选框 取值
<?//引入类?><!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">..2010-02-26 17:50:51 · 104 阅读 · 0 评论 -
根据IP自动切换城市(腾讯网接口)
<script src="http://fw.qq.com/ipaddress" type="text/javascript"></script><script type="text/javascript">//<![CDATA[ alert(IPData.join('\n')); alert(IPData[3]);//]]&am2010-05-27 10:02:47 · 436 阅读 · 0 评论 -
eclipse自动补全
eclipse自动补全配置原创 2010-09-05 11:11:43 · 65 阅读 · 0 评论 -
smarty变量操作符
capitalize [首字母大写] count_characters [计算字符数] cat [连接字符串] count_paragraphs [计算段落数]count_sentences [计算句数]count_words [计算词数]date_format [时间格式]default [默认]escape [转码] /escape:"html" htmla...原创 2010-09-05 14:17:38 · 113 阅读 · 0 评论 -
discuz 7.2数据库表结构
discuz 7.2数据库结构表 discuz, 结构, 数据库discuz数据字典(一)cdb_access 用户版块权限表 表说明:设置某一用户对某一版块的用户权限。 字段 类型 Null 默认 注释uid mediumint(8) 否 0 关联主键,特殊用户的UIDfid smallint(6) 否 0 关联主键,版块的FIDallowview tinyint(1) 否 0 浏览版块许可...原创 2010-09-09 15:54:11 · 327 阅读 · 0 评论 -
discuz 文件说明
文件颜色说明:红色:程序核心文件,修改这类文件时千万要注意安全!橙色:做插件几乎不会用到的文件,大概了解功能就可以了,其实我也不推荐修改这些文件绿色:函数类文件,许多功能强大的自定义函数可以调用这类文件来使用蓝色:最标准的插件制作常用文件紫色:该文件被Zend加密,请不要修改这类文件每个目录里面都有一个空的index.htm,这是为了防止列目录用的,不必理会.根目录 ./ (这里都是最基本的程序)...原创 2010-09-10 15:39:45 · 315 阅读 · 0 评论 -
discuz7.2 二次开发---------后台添加菜单
menu.inc.php showmenu('test', array( array('menu_test', 'tests'), array('menu_ttt_merge', 'tests&operation=edit'),)); main.inc.php showheader('test', 'tests');并在JS中加入<script...原创 2010-09-15 15:13:36 · 111 阅读 · 0 评论 -
Using PDO Objects in PHP 5 - Using the PDO extension
Definitely, a good point to start demonstrating the excellent functionality provided by the PDO extension is in showing how it can be used to connect to diverse database systems. Therefore, I coded...原创 2010-12-22 12:13:24 · 120 阅读 · 0 评论 -
Using PDO Objects in PHP 5 - Running queries against a specific
Naturally, after learning how to open and close a connection to a specific database system, I'm sure that you'll want to see how to execute a query against a particular database. To perform this cr...原创 2010-12-22 12:41:04 · 123 阅读 · 0 评论 -
Using PDO Objects in PHP 5 - Finding insertion IDs for database rows
As I pointed out in the section you just read, the PDO extension also offers a handy method, called "lastInsertId()," which is useful in those situations where it's necessary to find out the ID of the...原创 2010-12-22 13:07:38 · 160 阅读 · 0 评论 -
cgi 启动问题
/usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 11016 -u nobody -C 64 /usr/local/php/bin/php-cgi 出现500 才发现是conf文件里的rewrite写错了... 备忘 !原创 2011-09-23 16:08:05 · 201 阅读 · 0 评论 -
php 图片 上传 程序
<?php/******************************************************************************参数说明:$max_file_size : 上传文件大小限制, 单位BYTE$destination_folder : 上传文件路径$watermark : 是否附加水印(1为加水印,其他为不加水...原创 2010-02-03 19:08:43 · 94 阅读 · 0 评论 -
常用类
// 过滤html代码function SpHtml2Text($str){ $str = preg_replace("/<sty(.*)\\/style>|<scr(.*)\\/script>|<!--(.*)-->/isU","",$str); $alltext = ""; $start = 1; for($i=0;$i<2010-05-04 10:41:29 · 73 阅读 · 0 评论 -
异常处理、clone与自动载入 (php)
方法名 __call($funname,$arr_value) 调用一些不存在的对象方法的异常处理,使程序继续正常运行。class My{function __call($n,$v){ echo "错误的方法名".$n; echo "错误的参数".Print_r($v); //因为参数会有多个所要用数组的方式保存,打印的时候也要就用print...原创 2010-01-28 21:01:14 · 75 阅读 · 0 评论 -
php加密解密
<? define('UC_KEY','finger'); //定义密钥 $str = '杜川'; $a = authcode($str, 'ENCODE'); //加密 echo '密文:'.$a;$b = authcode($a, 'DECODE',$UC_KEY); //解密 echo '原文:'.$b; /** * 字符串解密加密...2010-04-15 17:07:04 · 224 阅读 · 0 评论 -
php创建验证字符图片
<?php //(1)创建背景图像。建立一幅150*100的图像 $im = @imagecreate(150,100)or die ("没有安装GD图像库"); //设置背景颜色 $background_color = imagecolorallocate ($im, 255, 255, 255); //设置字体颜色 $text_color = imagecol...2010-04-16 09:24:11 · 81 阅读 · 0 评论 -
图片加水印
$file="7.jpg";$width_th=200;$height_th=100;$imgs=imagecreatefromjpeg($file);$bgc=imagecolorallocate($imgs,255,255,90); //背景色$fontcolor=imagecolorallocate($imgs,255,255,41); //字体色imagestri...2010-04-16 09:59:23 · 80 阅读 · 0 评论 -
用jcrop裁剪图片
<?if ($_SERVER['REQUEST_METHOD'] == 'POST'){$file="7.jpg";$imgs=imagecreatefromjpeg($file);$x=imagesx($imgs);$y=imagesy($imgs);$x1=$_POST['x1'];$x2=$_POST['x2'];$y1=$_POST['y1'];...2010-04-16 14:42:40 · 87 阅读 · 0 评论 -
PHP 生成HTML
[code="java"]$fp=fopen('文件路径及名称','r');$str=fread($fp,filesize('文件路径及名称'));$str=str_replace('要替换的标签','要替换的内容',$str);fclose($fp);$fop=fopen('要创建的文件','w');fwrite($fop,$str);fclose($fop);//删...原创 2010-01-24 12:45:58 · 133 阅读 · 0 评论 -
PHP上传
[code="java"]图片上传程序 上传文件: 允许上传的文件类型为:[/code]原创 2010-01-24 12:49:39 · 264 阅读 · 0 评论 -
小偷原理
[code="java"][/code]原创 2010-01-24 13:03:15 · 101 阅读 · 0 评论 -
PHP 类的封装、继承、重载、抽象
[code="java"] 封装关 键字 :public,protected,private封装相关函数:__set() , __get()public 表示全局,类内部外部子类都可以访问;protected 表示受保护的,只有本类或子类或父类中可以访问;private 表示私有的,只有本类内部可以使用;继承PHP类的继承,我们可以理解成共享被...原创 2010-01-25 22:58:39 · 101 阅读 · 0 评论 -
ajax 与 php 简单聊天室
[code="java"]原创 2010-01-26 22:30:58 · 120 阅读 · 0 评论 -
php SESSION 操作
[code="java"]启动 Session 会话,并创建一个 $admin 变量: 如果你使用了 Seesion,或者该 PHP 文件要调用 Session 变量,那么就必须在调用 Session 之前启动它,使用 session_start() 函数。其它都不需要你设置了,PHP 自动完成 Session 文件的创建。 执行完这个程序后,我们可以到系统临时...原创 2010-01-26 23:04:22 · 55 阅读 · 0 评论 -
PHP 关键字 final self static const
PHP 关键字 final self static const1、关键字 :final 用来定义类和方法的一个重要关键字,当定义类的时候该类将不能被继承,当用来定义方法的时候该方法将不能被重载final class class1{ //该类将不能被继承…… final function fun1(){ //该方法将不能被重载 …… }...原创 2010-01-28 09:13:59 · 94 阅读 · 0 评论 -
解决php中的Jquery中文参数问题
ajax代码 function classnameadd(){ $.ajax({ type:"post", url:"test.php", data:{bigclass:$("#bigclass").val(),moth:$("#addto").val()}, //addto为隐藏域; ...原创 2010-01-28 15:44:37 · 85 阅读 · 0 评论 -
PHP 接口与接口的引用
1、接口的介绍与创建 关键字 :interface2、接口的引用与规范 关键字 :implements接口:一种成员属性全部为抽象的特殊抽象类,在程序中同为规范的作用1、类中全部为抽象方法2、抽象方法前不用加abstract3、接口抽象方法属性为public4、成员属性必须为常量抽象:1、类中至少有一个抽象方法2、...原创 2010-01-28 19:53:53 · 179 阅读 · 0 评论 -
php 多态的介绍与优势
运算符 :instanceof PHP 一个类型运算符。instanceof 用来测定一个给定的对象是否来自指定的对象类。class A { }class B { }$thing = new A;if ($thing instanceof A) { echo 'A';}if ($thing instanceof B) { echo '...原创 2010-01-28 20:15:21 · 80 阅读 · 0 评论 -
PHP 多态简单示例
<?php interface myusbkou { function type();//类型 function action();//执行的操作 } class zip implements myusbkou { //继承接口 function type(){ echo "USB的2.0接口"; } function...2010-01-28 20:32:11 · 91 阅读 · 0 评论 -
cassandra CONNECT
<?php// Setting up nodes://// CassandraConn::add_node('192.168.1.1', 9160);// CassandraConn::add_node('192.168.1.2', 5000);//// Querying://// $users = new CassandraCF('Keyspa...原创 2012-02-25 12:22:50 · 184 阅读 · 0 评论