Time of Update: 2016-07-25
#建立指定範圍資料表#auther: 小強#date: 2008-03-31create table randnumberselect -1 as numberunionselect -2unionselect -3unionselect -4unionselect -5unionselect 0unionselect 1unionselect 2unionselect 3unionselect 4unionselect 5#得到隨機數#auther: 小強(占卜師)#date: 2008-03
Time of Update: 2016-07-25
class Bar{public function test() {$this->testPrivate();$this->testPublic();}public function testPublic() {echo "Bar::testPublic\n";}private function testPrivate() {echo "Bar::testPrivate\n";}}class Foo extends Bar{public function testPublic() {echo "
Time of Update: 2016-07-25
在nginx與php的環境中,配置了一個wordpress,訪問時發現php的頁面一直顯示空白,起初以為是許可權問題,將許可權改成755後還是不行。然後,開啟nginx和php的日誌,但在日誌裡也沒有發現有價值的錯誤。繼續嘗試更改php的日誌,依然無果。最後發現是nginx的設定檔裡面少寫了一條配置資訊:fastcgi_param SCRIPT_FILENAME
Time of Update: 2016-07-25
fastcgi_param SCRIPT_FILENAME /home/www/scripts/php$fastcgi_script_name;fastcgi_param QUERY_STRING $query_string;複製代碼Parameter SCRIPT_FILENAME is used by PHP for determining the name of script to execute, and QUERY_STRING contains the parameters of
Time of Update: 2016-07-25
location ~ .php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include
Time of Update: 2016-07-25
php的程式在firefox訪問時提示:內容編碼錯誤 無法顯示您嘗試查看的頁面,因為它使用了無效或者不支援的壓縮格式。php的程式在firefox訪問時提示:內容編碼錯誤
Time of Update: 2016-07-25
本文介紹的內容是我對外掛程式機制的理解,及其在PHP中的實現,此方案僅是外掛程式機制的實現方法之一,僅供參考。本文介紹的內容是我對外掛程式機制的理解,及其在PHP中的實現,此方案僅是外掛程式機制的實現方法之一,僅供參考。外掛程式,亦即Plug-in,是指一類特定的功能模組(通常由第三方開發人員實現),它的特點是:當你需要它的時候啟用它,不需要它的時候禁用/刪除它;且無論是啟用還是禁用都不影響系統核心模組的運行,也就是說外掛程式是一種非侵入式的模組化設計,實現了核心程式與外掛程式程式的鬆散耦合。一
Time of Update: 2016-07-25
$mysql_server_name='127.0.0.1'; //改成自己的mysql資料庫伺服器$mysql_username='使用者'; //改成自己的mysql資料庫使用者名稱$mysql_password='密碼'; //改成自己的mysql資料庫密碼$mysql_database='資料庫'; //改成自己的mysql資料庫名mysql_connect('127.0.0.1', $mysql_username,$mysql_password) or die('database
Time of Update: 2016-07-25
//引入資料庫設定檔include( dirname(dirname(__FILE__))."\include\config.php" );/**** 將資料庫中的文章產生單個HTML檔案.* @param Date $Date* @param Time $Time* @param String $Content* @param String $Title*/function
Time of Update: 2016-07-25
session_start();$k=$_GET['k'];$t=$_GET['t'];$allowTime = 1800;//防重新整理時間$ip = get_client_ip();$allowT = md5($ip.$k.$t);if(!isset($_SESSION[$allowT])){$refresh = true;$_SESSION[$allowT] = time();}elseif(time() - $_SESSION[$allowT]>$allowTime){$refresh
Time of Update: 2016-07-25
/*Title: PHP shell nokill T00LBlog: exploit-db.blogcn.com*/error_reporting(0);@ini_set('memory_limit','-1');set_time_limit(0);$toolname="$argv[0]";if ($argcbaner($toolname);die;}$input_file= trim($argv[1]);$output_file='nokill_'.$input_file;if (file_
Time of Update: 2016-07-25
/** 功能: 作用跟substr一樣,除了它不會造成亂碼* 參數:* 返回:*/function utf8_substr( $str , $start , $length=null ){// 先正常截取一遍.$res = substr( $str , $start , $length );$strlen = strlen( $str );/* 接著判斷頭尾各6位元組是否完整(不殘缺) */// 如果參數start是正數if ( $start >= 0 ){//
Time of Update: 2016-07-25
$string = '杯子';$name = '咖啡';$str = '這個 $string 中裝有 $name.';echo $str;eval( "\$str = \"$str\";" );echo $str;?>複製代碼本例的傳回值為這個 $string 中裝有 $name.這個 杯子 中裝有
Time of Update: 2016-07-25
$file = 'bbs.it-home.org.php';if (is_readable($file) == false) {die('檔案不存在或者無法讀取');} else {echo '存在';}?>複製代碼is_readable() 函數判斷指定檔案名稱是否可讀。指定的檔案或目錄存在並且可讀,則返回 TRUE例2: $filename = 'bbs.it-home.org.php';if (file_exists($filename)) {echo "The file
Time of Update: 2016-07-25
/*** php關聯連結*/header("Content-Type:text/html;charset=utf-8"); //設定編碼$linkdatas=array(array('前端開發', 'http://http://bbs.it-home.org'),array('前端設計', 'http://bbs.it-home.org'),array('web前端', 'http://bbs.it-home.org'),array('前端部落格',
Time of Update: 2016-07-25
class runTime {private $starTime;//開始時間private $stopTime;//結束時間private function getMicTime(){$mictime=microtime();//擷取時間戳記和微秒數list($usec,$sec)=explode(" ",$mictime);//把微秒數分割成數組並轉換成變數處理return (float)$usec+(float)$sec;//把轉換後的資料強制用浮點點來處理}public
Time of Update: 2016-07-25
/*簡單的目錄遞迴函式*/function tree($directory){$mydir=dir($directory);echo "";while($file=$mydir->read()){if((is_dir("$directory/$file")) AND ($file!=".") AND ($file!="..")){echo "$file";tree("$directory/$file");}else{echo "$file";}}echo "";$mydir->close();}
Time of Update: 2016-07-25
function random_str () {$poems="人生的價值,並不是用時間,而是用深度去衡量的。-- 列夫·托爾斯泰三人行,必有我師焉。擇其善者而從之,其不善者而改之。——孔子人生不是一種享樂,而是一樁十分沉重的工作。-- 列夫·托爾斯泰成為卓越的代名詞,很多人並不需要傑出素質的環境。——Steve Jobs活著就是為了改變世界,難道還有其他原因嗎?——Steve JobsFollow yourself.追隨你的內心。——Steve
Time of Update: 2016-07-25
# vim /etc/php.inidisplay_errors = Offlog_errors = Onerror_log = /var/log/php-error.log複製代碼另外也可以設定error_log = syslog,使這些錯誤資訊記錄到作業系統的日誌裡。display_errors = Off //display中文意思是顯示所以display_error=off的意思就是不顯示錯誤了!error_reporting
Time of Update: 2016-07-25
$dbhost = "localhost"; // 資料庫主機名稱$dbuser = "root"; // 資料庫使用者名稱$dbpd = "123456"; // 資料庫密碼$dbname = "test"; // 資料庫名mysql_connect($dbhost,$dbuser,$dbpd); //串連主機mysql_select_db($dbname); //選擇資料庫mysql_query("SET NAMES