Quantcast
Channel: PHP
Browsing all 50 articles
Browse latest View live

php 文件上传类(2)

} function getNewFileName(){ return $this-newFileName; } private function getFileErrorFromFILES(){ return $this-fileField['error']; } private function getFileTypeFromFILES(){...

View Article



php 文章管理

url=http://www.55zm.com/kf/web/php/]php[/url] /** * 文章 * 2011/9/21 * kcj * */ include isLogin.php; include ../conn/config.inc.php; include_once(../FCKeditor/fckeditor.php); $oFCKeditor = new...

View Article

php 文章管理(2)

location:/admin/article.php?action=list); }else { echo 修改失败!; } } /*删除*/ elseif ($_REQUEST['action']=='del'){ $id=$_GET['id']; del($id); } /*审核文章*/ elseif ($_REQUEST['action']=='shenhe'){...

View Article

php json

大家也许都对PHP已经不再陌生,那么对于JSON的了解又如何呢?今天我们就向大家简要的介绍PHP使用JSON的具体编码,希望本文内容对又需要的朋友有所帮助。 互联网的今天,AJAX已经不是什么陌生的词汇了。说起AJAX,可能会立即想起因RSS而兴起的XML。XML的解析,

View Article

jQuery/Ajax/PHP/Json 的一个综合例子

jQuery 是一个优秀的 Javascript 框架,对 js 进行了优秀的包装,提供了许多方便的功能。jQuery 对 ajax 的包装也堪称优秀。 jQuery 可以以 json 文件传输协议来传输数据(类似 xml,而且大有取代 xml 的趋势),而网站后台代码必须与之配合使用。PHP 是用 jso

View Article


php的功能

1. PHP可阅读随机字符串 此代码将创建一个可阅读的字符串,使其更接近词典中的单词,实用且具有密码验证功能。 /************** *@length - length of random string (must be a multiple of 2) **************/ function readable_random_string($length =

View Article

php的功能(2)

$string; // is $break present between $limit and the end of the string? if(false !== ($breakpoint = strpos($string, $break, $limit))) { if($breakpoint strlen($string) - 1) { $string = substr($string,...

View Article

php的功能(3)

attribute echo $user['id'], ' '; //subnodes are accessed by - operator echo $user-name, ' '; echo $user-email, 'br /'; } 9. PHP创建日志缩略名 创建用户友好的日志缩略名。 function create_slug($string){...

View Article


php判断客户端是否为手机

url=http://www.55zm.com/kf/web/php/]php[/url] //php判断客户端是否为手机 $agent = $_SERVER['HTTP_USER_AGENT']; if(strpos($agent,NetFront) || strpos($agent,iPhone) || strpos($agent,MIDP-2.0) || strpos($agent,Opera...

View Article


php 图片处理类

url=http://www.55zm.com/kf/web/php/]php[/url] class Image { private $path; //构造方法用来对图片所在位置进行初使化 function __construct($path=./){ $this-path=rtrim($path, /)./; } /* 对图片进行缩放 * * 参数$name: 是需要处理的图片名称 *

View Article

php 图片处理类(2)

//图片等比例缩放的算法 if($imgInfo[width]*$size[width] $imgInfo[height] * $size[height]){ $size[height]=round($imgInfo[height]*$size[width]/$imgInfo[width]); }else{...

View Article

文件写入

//index.php 页面 $incpeizhi=inc.peizhi.php; $arr=array('mark_h','mark_w','mark_name','mark_url','mark_type'); extract($_POST); echo $mark_name; echo br; $configstr = ; foreach($arr as $v) { echo $v;...

View Article

php无限分类读取多级菜单

//数据库表 ?php include comm.php; //获取分类菜单 $arr=getTree(); $arrone=getFlone(59); $arrtwo=getFltwo(93); $arrmenu=getFlmenu(59); print_r($arrmenu); //获取分类树 function getTree(){ global $db; $sql=select...

View Article


php 多功能搜索

$flag=$_POST['flag']; $sosoval=$_POST['keyword']; $sosoquery=where 1=1 ; if(!emptyempty($sosoval)$flag!=='-1'){ //$sosoquery.=and (title like '%$sosoval%') or (keyword like '%$sosoval%') or (author...

View Article

php 生成静态html

url=http://www.55zm.com/kf/web/php/]php[/url] require comm.php; if(isset($_POST['submit'])){ $title=$_POST['title']; $content=$_POST['content']; $addtime=time(); $sql=insert into news...

View Article


break、continue 和return 在程序中的重要性

第一:break语句通常用在循环语句和开关语句中,当break语句用于do-while、for、while循环语句中时,可使程序终止循环而执行循环后面的语句, 通常break语句总是与if语句联在一起,即满足条件时便跳出循环。 例如: main() { int i=0; char c; while(1) /*设置循

View Article

mysql中UNIX_TIMESTAMP()函数和php中time()函数的区别

mysql 中:UNIX_TIMESTAMP(), UNIX_TIMESTAMP(date) 若无参数调用,则返回一个Unix timestamp ('1970-01-01 00:00:00' GMT 之后的秒数) 作为无符号整数。若用date 来调用UNIX_TIMESTAMP(),它会将参数值以'1970-01-01 00:00:00' GMT后的秒数的形式返回。date

View Article


php 投票(调查)

url=http://www.55zm.com/kf/web/php/]php[/url] /** * 投票调查 * * * */ include isLogin.php; include ../conn/config.inc.php; /*action操作初始化*/ if(emptyempty($_REQUEST['action'])){ $_REQUEST['action']='list';...

View Article

通过PHP的hash冲突漏洞进行DDoS攻击

文件dos.php // 目标地址 // 只要目标地址存在,不用管它是干嘛的 $host = 'http://127.0.0.1/test.php'; $data = ''; $size = pow(2, 15); for ($key=0, $max=($size-1)*$size; $key=$max; $key+=$size) { $data .= ' } $ret = curl($host,...

View Article

php 常用函数收藏(二)

/** * 读取缓存,默认为文件缓存,不加载缓存配置。 * @param string $name 缓存名称 * @param $filepath 数据路径(模块名称) caches/cache_$filepath/ * @param string $config 配置名称 */ function getcacheinfo($name, $filepath='', $type='file', $c

View Article
Browsing all 50 articles
Browse latest View live




Latest Images