This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ftp { | |
var $ftpUrl = ''; | |
var $ftpUser = ''; | |
var $ftpPass = ''; | |
var $ftpDir = ''; | |
var $ftpR = ''; //R ftp资源; | |
var $status = ''; | |
//R 1:成功;2:无法连接ftp;3:用户错误; | |
function ftp($ftpUrl="", $ftpUser="", $ftpPass="", $ftpDir="") { | |
if($ftpUrl){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @version v1.0 | |
* @copyright 2010.08.25 | |
* @author jiangzubin<jiang.zubin@onlylady.com> | |
* | |
* @todo | |
*/ | |
class Controller_Add extends CController | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//爬虫 | |
$url = 'http://www.101xd.com/'; | |
getdata($url); | |
function getdata($usl){ | |
$url_array = array(); | |
$the_first_content=file_get_contents($url); | |
$the_second_content=file_get_contents($url); | |
$pattern1 = "/http:\/\/[a-zA-Z0-9\.\?\/\-\=\&\:\+\-\_\'\"]+/"; | |
$pattern2="/http:\/\/[a-zA-Z0-9\.]+/"; | |
preg_match_all($pattern2, $the_second_content, $matches2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
session_start(); | |
//关闭报错 | |
error_reporting(0); | |
//图片宽度 | |
$x_size=120; | |
//图片高度 | |
$y_size=25; | |
$action = $_GET['action']; | |
$nmsg=num_rand(4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pageBar($current_page, $page_size, $max_show, $min_show, $total_nums) { | |
$current_page = max(1,$current_page); | |
$total_page = ceil($total_nums/$page_size); | |
$current_page = min($total_page, $current_page); | |
$link_pre = get_link('p', ''); | |
$html_page = ''; | |
if ($max_show%2 == 0) {//奇偶数判断 | |
$start_show = $current_page - ceil($max_show/2); | |
$end_show = $current_page + ceil($max_show/2) - 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!$_FILES){ | |
exit("上传文件不能空"); | |
} | |
if(!$_POST['filename']){ | |
exit("目录名不能空"); | |
} | |
if(end(explode('.',$_FILES["file"]["name"]))!='zip'){ | |
exit("请上传zip格式的文件"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
var data = <?=$editData;?>; | |
var f = new loadform(document.form1, data); | |
}); | |
function loadform(form,thedata) { | |
this.objs = form.elements; | |
this.data = thedata; | |
for (var i=0;i<this.objs.length;i++){ | |
if (this.data[this.objs[i].name] != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://new-icon.ol-img.com/newcms/js/jquery.validate.js"></script> | |
function validate(){ | |
$("#form1").validate({ | |
rules: { | |
name: "required", | |
ename: "required", | |
description : "required" | |
}, | |
messages: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1 localhost | |
127.0.1.1 ubuntu | |
# The following lines are desirable for IPv6 capable hosts | |
::1 localhost ip6-localhost ip6-loopback | |
fe00::0 ip6-localnet | |
ff00::0 ip6-mcastprefix | |
ff02::1 ip6-allnodes | |
ff02::2 ip6-allrouters | |
ff02::3 ip6-allhosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//抓取图片 | |
private function loadPic($src,$desc) | |
{ | |
$opts = array( | |
'http'=>array( | |
'method'=>"GET", | |
'timeout'=>12, | |
) | |
); | |
$context = stream_context_create($opts); |
OlderNewer