Time of Update: 2015-09-04
標籤:test.php<?phpheader("Content-type:text/html;charset=‘utf8‘");error_reporting(E_ALL);echo "類比資料庫常用操作效果<br>";echo "<a href=‘check.php?action=add‘>執行增加操作</a><br>";echo "<a href=‘check.php?action=del‘>執行刪除操作</a>&
Time of Update: 2015-08-27
標籤:2015-08-27 php大力力023.CREATE TABLE建立新表sql寫欄位備忘http://www.cnblogs.com/dalitongxue/p/4762182.html參考:MySQL欄位的說明和備忘資訊http://blog.csdn.net/chelen_jak/article/details/45689139DROP TABLE IF EXISTS test_table; CREATE TABLE test_table( Test_ID int
Time of Update: 2015-08-13
標籤:1.對查詢進行最佳化,應盡量避免全表掃描,首先應考慮在 where 及 order by 涉及的列上建立索引。 2.應盡量避免在 where 子句中對欄位進行 null 值判斷,否則將導致引擎放棄使用索引而進行全表掃描,如: select id from t where num is null 可以在num上設定預設值0,確保表中num列沒有null值,然後這樣查詢: select id from t where
Time of Update: 2015-08-09
標籤: 字型:[增加 減小] 類型:轉載前幾天,覺得blog的插入代碼不夠好用。於是,將sina的html編輯器更換為了tinyMCE。並且開發了一個簡單的插入代碼的功能。。。 下面就是我開發的過程。 首先,我的 tinyMCE版本是 Version: 3.2.7 (2009-09-22) 。 http://www.jb51.net/codes/17198.htmltinyMCE插入代碼,需要調用 tinyMCE的
Time of Update: 2015-07-22
標籤:SQL注入原理:就是通過把SQL命令插入到Web表單遞交或輸入欄位名或頁面請求的查詢字串,最終達到欺騙伺服器執行惡意的SQL命令。以下介紹SQL注入方式:首先建表如下:1 create database sqltest charset utf82 3 create table test (4 id int,5 name varchar(10),6 age tinyint unsigned7 )engine=myisam
Time of Update: 2015-06-02
標籤:php增加對mysqli的支援 我在fedora下使用yum安裝的php和mysql,但是發現php不支援myslqi,只能編譯一個mysqli的擴充給php用了。方法如下:1.下載php2.進入擴充目錄,cd /php-5.3.10/ext/mysqli3.phpize 產生configure4.如果在編譯php對mysqli的支援的時候出現了如下錯誤:checking whether to enable embedded
Time of Update: 2015-05-29
標籤:php mysqli 查詢 輸出結果 php串連mysql我有文章已經寫過了,這篇文章主要是介紹從mysql中查詢出結果之後怎麼輸出的問題。 一:mysqli_fetch_row(); 查詢結果:array([0]=>小王) 查詢:while ($row = mysqli_fetch_assoc($result)) {
Time of Update: 2015-05-29
標籤:http://www.jb51.net/article/61193.htm——————————————————————————————
Time of Update: 2015-05-26
標籤:匯出資料執行個體如下:<?php$mdb_host = $g_c["db"][0]["managertool"]["host"]; //資料庫ip地址$mdb_user = $g_c["db"][0]["managertool"]["user"]; //資料庫使用者名稱,(預設:root)$mdb_pwd = $g_c["db"][0]["managertool"]["pwd"]; //資料庫密碼$mdb_db =
Time of Update: 2015-05-19
標籤:catalog1. 漏洞描述2. 漏洞觸發條件3. 漏洞影響範圍4. 漏洞程式碼分析5. 防禦方法6. 攻防思考 1. 漏洞描述會員模組中存在的SQL注入Relevant Linkhttp://www.cnseay.com/1959/ 2. 漏洞觸發條件1. 開啟 http://127.0.0.1/dedecms/member/flink_main.php#2. 在串連網址裡面寫入 http://sss2‘),(8,1,@`‘`),(8,(select user()),
Time of Update: 2015-07-28
標籤:演算法 hash 下面使用php實現一致性Hash分布演算法。 建立一個ConHash類,它有兩個成員變數和三個成員方法。 變數: serverList//保存服務器列表isSorted //記錄伺服器列表是否已經排過序。 方法: addServer:添加一個伺服器到伺服器列表中 removeServer:從伺服器列表中刪除一個伺服器 lookup:從當前伺服器列表中找到合適的伺服器存放資料。代碼如下:<?php
Time of Update: 2015-07-25
標籤:<?php/** * byte數組與字串轉化類 * @author ZT */class Bytes { /** * 轉換一個string字串為byte數組 * @param $str 需要轉換的字串 * @param $bytes 目標byte數組 */ public static function getbytes($str) { $len = strlen($str); $bytes =
Time of Update: 2015-07-19
標籤:1、多維陣列2、日期,d - 表示月裡的某天(01-31)m - 表示月(01-12)Y - 表示年(四位元)1 - 表示周裡的某天© 2010-<?php echo date("Y")?>,使用 date() 函數在您的網站上自動更新版本年份h - 帶有首位零的 12 小時小時格式i - 帶有首位零的分鐘s - 帶有首位零的秒(00 -59)a - 小寫午前和午後(am 或
Time of Update: 2015-07-16
標籤: 1 /** 2 * 排序 3 * @param $array 要排序的數組 4 * @param $keys 用來排序的鍵名 5 * @param string $type 預設為升序排序 6 */ 7 function array_sort($array,$keys,$type=‘ASC‘){ 8 $keysvalue = $new_array = array(); 9 foreach ($array as $k=>$v){10
Time of Update: 2015-07-09
標籤: PHP ECMAScript 長度 $length = count($array) length = array.length 增 array_unshift($array, new1,new2) 開頭添加一個或多個元素,返回長度 array.unshift(new1,new2)
Time of Update: 2015-07-03
標籤:參數 php value 文法 數字 首先,先把我用過的幾個array的函數寫出來 ①.in_array 我自己的感悟:in_array的話,第一個參數是你想要尋找的字串或者數字,然後第二個是數組,是你然後如果你的第一個參數的值在這個數組裡面的話,就返回ture,否則就返回false。定義和用法: in_array()
Time of Update: 2015-07-01
標籤: 非ajax,非iframe,最原始使用file控制項的檔案上傳,記錄過程備忘。 實現目標,能夠將檔案上傳到指定位置。 用戶端用input的file控制項:<form action=‘data.php‘ method=‘post‘ enctype=‘multipart/form-data‘> <input type=‘file‘ name=‘file‘ /> <input type=‘submit‘
Time of Update: 2015-05-27
標籤:function select_sort($arr) {//實現思路 雙重迴圈完成,外層控制輪數,當前的最小值。內層 控制的比較次數 //$i 當前最小值的位置, 需要參與比較的元素 for($i=0, $len=count($arr); $i<$len-1; $i++) { //先假設最小的值的位置 $p = $i; //$j 當前都需要和哪些元素比較,$i 後邊的。 for($j=$i+1;
Time of Update: 2015-07-07
標籤:[轉] http://www.cnblogs.com/fengyuqing/p/php_nginx.html1、首先需要準備的應用程式套件組合。 nginx:nginx/Windows-1.0.4 php:php-5.2.16-nts-Win32-VC6-x86.zip (nginx下php是以FastCGI的方式運行,所以我們下載非安全執行緒也就是nts的php包) (還會用到)RunHiddenConsole:RunHiddenConsole.zip 
Time of Update: 2015-05-22
標籤: 官方下載的php安裝包ext目錄裡以經包含了常用的php擴充,但某些情況下並不能滿足我們項目需求,比如memcache擴充就不在官方的php安裝包裡。這時就需要我們自己去下載安裝。 本文列出php官方提供的php擴充。同時給出windows下安裝php擴充的步驟(以安裝memcache擴充為例說明)。假設在windows上已經安裝好memcached伺服器,啟動memcached服務的方法是:可在網上直接下載memcached.exe可執行檔,然後在cmd中找到該檔案,使用命令