php使用ftp函數建立目錄(產生靜態)

/*** desc:create directory through FTP connection* link:bbs.it-home.org* date:2013/02/24*/function FtpMkdir($path, $newDir) { $server='ftp.yourserver.com'; // ftp server $connection = ftp_connect($server); // connection // login to ftp

php使用header函數設定各種HTTP頭的例子

/** desc:header函數設定各種HTTP頭 link:bbs.it-home.org date:2013/2/24*///定義編碼 header( 'Content-Type:text/html;charset=utf-8 '); //Atom header('Content-type: application/atom+xml'); //CSS header('Content-type: text/css'); //Javascript header(

php寫的ftp檔案上傳類

/** * desc:FTP類* link:bbs.it-home.org* date:2013/02/24 */ class ftp { public $off; // 返回操作狀態(成功/失敗) public $conn_id; // FTP串連 /** * 方法:FTP串連 * @FTP_HOST -- FTP主機 * @FTP_PORT -- 連接埠 * @FTP_USER -- 使用者名稱 * @FTP_PASS -- 密碼 */ function

php網站如何防止sql注入?【上】

網站的運行安全肯定是每個站長必須考慮的問題,大家知道,大多數駭客攻擊網站都是採用sql注入,這就是我們常說的為什麼 ?

php與Mysql日期時間(UNIX時間戳記、格式化日期)轉換的方法

寫過PHP+MySQL的程式員都知道有時間差,UNIX時間戳記和格式化日期是我們常打交道的兩個時間表示形式,Unix時間戳記儲存、處理方便,但是不直觀,格式化日期直觀,但是處理起來不如Unix時間戳記那麼自如,所以有的時候需要互相轉換,下面給出互相轉換的幾種轉換方式。 一、在MySQL中完成 這種方式在MySQL查詢語句中轉換,優點是不佔用PHP解析器的解析時間,速度快,缺點是只能用在資料庫查詢中,有局限性。 1. UNIX時間戳記轉換為日期用函數:

有關php串連mssql的一些總結

$conn=mssql_connect("執行個體名或者伺服器IP","使用者名稱","密碼"); //測試連接if($conn){echo "串連成功";} 複製代碼 2、選擇要串連的資料庫 mssql_select_db("dbname"); 複製代碼 3、執行查詢 $rs = mssql_query("select top 1 id,username from

四個php中文字串截取函數

//截取中文字串function mysubstr($str, $start, $len) {$tmpstr = "";$strlen = $start + $len;for($i = 0; $i if(ord(substr($str, $i, 1)) > 0xa0) {$tmpstr .= substr($str, $i, 2);$i++;} else$tmpstr .= substr($str, $i, 1);}return $tmpstr;}?>複製代碼2、截取utf8編碼的多位元組字串/

php拆分數組的二個函數(array_slice()、array_splice())

$input = array("a", "b", "c", "d", "e");$output = array_slice($input, 2); // returns "c", "d", and "e"$output = array_slice($input, -2, 1); // returns "d"$output = array_slice($input, 0, 3); // returns "a", "b", and "c"// note the differences in the

用於批量產生隨機使用者名稱的php程式

/* 從字典檔案中提取隨機值 */$file1 = "./Words.dic";$file2 = "./common_pass_mini.dic";$file3 = "./Sys_Month_Date.Dic";$rfile = "./5.dic";$n = 2000;//提取字典$basef = file($file1);$extf = file($file2);$extf2 = file($file3);$bf_sum = (count($basef)-1);$ef_sum =

php MD5加密詳解

mysql>CREATE TABLE members (->username CHAR(14) NOT NULL,->password CHAR(32) NOT NULL,->PRIMARY KEY(username)->);複製代碼然後,我們可以輸入使用者的資料到該表中:使用者名稱 密碼Tom keloD1C377lKEJohn ba1T7vnz9AWgkBill paLUvRWsRLZ4U這些加密的口令對應的明碼分別是Tom、John和Bill。我們將根據口令的前二個字母建立幹擾串:

php file_get_contents函數代理擷取遠程頁面的代碼

$url = "http://bbs.it-home.org/";$ctx = stream_context_create(array('http' => array('timeout' => 5,'proxy' => 'tcp://60.175.203.243:8080','request_fulluri' => True,)));$result = file_get_contents($url, False, $ctx);echo $result;?>複製代碼2、curl 代理的方法:

php使用PDO操作資料庫的類(Mysql下適用)

/*** 作者:胡睿* 日期:2012/07/21* 電郵:hooray0905@foxmail.com*/class HRDB{protected $pdo;protected $res;protected $config;/*建構函式*/function __construct($config){$this->Config = $config;$this->connect();}/*資料庫連接*/public function connect(){$this->pdo = new PDO($

php 修改 增加xml結點屬性的代碼

複製代碼2、php代碼 $dom=new DOMDocument('1.0');$dom->load('x.xml');$em=$dom->getElementsByTagName('emotions');$em=$em->item(0);$items=$em->getElementsByTagName('item');foreach($items as $a){foreach($a->attributes as

又一個php FTP上傳類

/** php ftp上傳類 link:bbs.it-home.org date:2013/2/25*///R FTP 處理;class ftp {var $ftpUrl = '58.123.24.32';var $ftpUser = 'test123';var $ftpPass = 'yourpassword';var $ftpDir = '/others/';var $ftpR = ''; //R ftp資源;var $status = '';//R 1:成功;2:無法串連ftp;3:

快速自動安裝php擴充模組的方法

wget http://pear.php.net/go-pear php go_pear[root@localhost ~]# php go-pearWelcome to go-pear!Go-pear will install the 'pear' command and all the files needed byit. This command is your tool for PEAR installation and maintenance.Go-pear also lets

php中文字串截取 php截取中文字串的代碼

/** @截取中文字串 適用於GB2312編碼 @http://bbs.it-home.org*/function FSubstr($title,$start,$len="",$magic=true){$length = 0;if($len == "") $len = strlen($title);//判斷起始為不正確位置if($start > 0){$cnum = 0;for($i=0;$i{if(ord(substr($title,$i,1)) >= 128) $cnum ++;}if(

php error_reporting()函數的用法舉例(錯誤捕捉)

display_errors = Offerror_reporting = E_ALL複製代碼通過在 php.ini 檔案中搜尋它們,可以發現這兩個變數當前的預設值。display_errors 變數的目的很明顯 —— 它告訴 PHP 是否顯示錯誤。預設值是 Off。但是,要讓開發過程更加輕鬆,請把這個值設為 On: display_errors = On複製代碼error_reporting 變數的預設值是 E_ALL。這個設定會顯示從不良編碼實踐到無害提示到出錯的所有資訊。E_ALL

php中文字串截取 php截取中文字串的函數

/** @中文字串截取函數 @http://bbs.it-home.org*/function cnSubStr($string,$sublen){if($sublen>=strlen($string)){return $string;}$s="";for($i=0;$i{if(ord($string{$i})>127){$s.=$string{$i}.$string{++$i};continue;}else{$s.=$string{$i};continue;}}return $s;}//

php資料備份:單表備份 整表備份 匯入資料庫

class Db { var $conn; function Db($host="localhost",$user="root",$pass="root",$db="test") { if(!$this->conn=mysql_connect($host,$user,$pass)) die("can't connect to mysql sever");

php auto_prepend_file和auto_append_file的用法

auto_prepend_file = "c:/Program Files/include/header.php" auto_append_file = "c:/Program Files/include/footer.php"複製代碼unix中這樣設定: auto_prepend_file = "/home/username/include/header.php" auto_append_file =

總頁數: 5203 1 .... 2140 2141 2142 2143 2144 .... 5203 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.