Time of Update: 2018-07-29
恩,算是開葷了。用PHP連了一次Mysql資料庫,做了個插入的操作。記錄一下啊。以前是用JAVA的,什麼JSP/Servlet,Struts2,Hibernate,Spring,現在用用PHP,覺得還蠻新鮮的。不過,以後寫項目肯定不能這麼寫,肯定得分層,肯定得用MVC設計模式。然後,再學習一下PHP有木有什麼好的架構。 <html><head><meta http-equiv="Content-Type"
Time of Update: 2018-07-29
1、安裝下面程式包為即將開始的PHP安裝配置系統內容 [root@localhost~]#yum install libxml2 libxml2-developenssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeglibjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devellibmcrypt libmcrypt-devel
Time of Update: 2018-07-29
需要用PHP發送郵件,不想要PHPmailer那麼複雜,找來找去,總算找到了一個好用的,分享出來,PHP郵件發送類,一共包含兩個檔案.代碼如下: sent_mail.php <?phprequire_once('email.class.php');//##########################################$smtpserver = "smtp.163.com";//SMTP伺服器$smtpserverport =
Time of Update: 2018-07-29
第一次安裝nginx,安裝完成後發現thinkphp無法運行。查閱相關資料後通過以下方式解決: 配置nginx pathinfo支援: 原始配置完成後: #location ~ \.php$ { # root
Time of Update: 2018-07-29
JS前端寫法: 第三個參數判斷是否需要用省略符號 function subString(str, len, hasDot) { var newLength = 0; var newStr = ""; var chineseRegex = /[^\x00-\xff]/g; var singleChar = ""; var strLength =
Time of Update: 2018-07-30
多檔案上傳的外掛程式常用的有: 1、jquery uploadify 下載【http://www.uploadify.com/download/】 2、jquery file upload 下載【https://github.com/blueimp/jQuery-File-Upload/tags】 3、webuploader 下載【http://fex.baidu.com/webuploader/download.html】 註:
Time of Update: 2018-07-29
php字串處理函數庫 AddSlashes 字串加入斜線。 文法: string addslashes(string str); 傳回值: 字串 函數種類: 資料處理 本函數使需要讓資料庫處理的字串,引號的部份加上斜線,以供資料庫查詢 (query) 能順利運作。這些會被改的字元包括單引號 (')、雙引號 (")、反斜線 backslash (/) 以及Null 字元 NUL
Time of Update: 2018-07-30
<?php/** * Created by PhpStorm. * User: Ollydebug * Date: 2015/11/15 * Time: 15:20 *//* * U-懶惰匹配 * i-忽略英文字母大小寫 * x-忽略空白 * s-讓元字元' . '匹配包括分行符號內所有字元 */$pattern = '/Go Ogle.+123/Uix';$subject = 'I love google__123123123123123123';$matches = array()
Time of Update: 2018-07-30
用PHP過濾html裡可能被利用來引入外部危險內容的代碼。有些時候,需要讓使用者提交html內容,以便豐富使用者發布的資訊,當然,有些可能造成顯示頁面配置混亂的代碼也在過濾範圍內。 以下是引用片段: #使用者發布的html,過濾危險代碼 function uh($str) { $farr = array(
Time of Update: 2018-07-30
使用PHP操作Memcached 1.建立一個Memcached對象 $m = new Memcached(); 2.傳入伺服器 //一台伺服器 $m->addServer('127.0.0.1','11211'); //多台伺服器 $servers = array( array('127.0.0.1','11211'), array('127.0.0.2','11
Time of Update: 2018-07-30
//第一步://路徑:phpcms/modules/content/content.php//構造方法public function __construct() {parent::__construct();$this->db = pc_base::load_model('content_model');//內容模型資料庫操作類$this->siteid = $this->get_siteid();//當前網站id$this->categorys = getcache('
Time of Update: 2018-07-30
<?php$handler=mysql_connect("localhost","root","password");mysql_select_db("task");mysql_query("SET
Time of Update: 2018-07-31
MySQL資料庫編碼、html頁面編碼、PHP或html檔案本身編碼要全部一致。 1、MySQL資料庫編碼:建立資料庫時指定編碼(如gbk_chinese_ci),建立資料表、建立欄位、插入資料時不要指定編碼,會自動繼承資料庫的編碼。 資料庫連接時,也有編碼,可以在串連完資料庫後,執行mysql_query('SET NAMES gbk');//將gbk換成你的編碼,如utf8。 2、html頁面的編碼,指的是這一行的設定:<meta
Time of Update: 2018-07-31
1.下載httpd2.4.4,存放目錄:/home/aaron/httpd-2.4.4.tar.gz,解壓 tar -zxvf httpd-2.4.4.tar.gz 2.安裝 進入解壓後的/home/aaorn/httpd-2.4.4目錄,執行./configure --prefix=/home/aaron/httpd,提示: checking for APR... configure: WARNING: APR version 1.4.0 or later is
Time of Update: 2018-07-31
MySQL資料庫編碼、html頁面編碼、PHP或html檔案本身編碼要全部一致。1、MySQL資料庫編碼:建立資料庫時指定編碼(如gbk_chinese_ci),建立資料表、建立欄位、插入資料時不要指定編碼,會自動繼承資料庫的編碼。資料庫連接時,也有編碼,可以在串連完資料庫後,執行mysql_query(‘SET NAMES gbk’);//將gbk換成你的編碼,如utf8。 2、html頁面的編碼,指的是這一行的設定:<meta http-equiv=”Content-
Time of Update: 2018-07-31
PHP Ajax 跨域問題最佳解決方案 本文通過設定Access-Control-Allow-Origin來實現跨域。 例如:用戶端的網域名稱是client.runoob.com,而請求的網域名稱是server.runoob.com。 如果直接使用ajax訪問,會有以下錯誤: XMLHttpRequest cannot load http://server.runoob.com/server.php. No
Time of Update: 2018-07-31
標籤:style tps win mysql reac eal public expect key 版本 CodeIgniter 3 PHP
Time of Update: 2018-08-02
標籤:fun rda public php 數組 lse 數組 [] self count() public function invitation($appId,$type){$arr =
Time of Update: 2018-07-30
標籤:菜單 rap 結果 res com https llb pre 開啟 1.使用sublime編寫python代碼開啟sublime軟體,Tools —> Build
Time of Update: 2018-07-30
標籤:就是 學曆教育 總結 適合 ber 小項目 部署 貴的 快速迭代 PHP與J2EE的對比網上有很多關於PHP與J2EE之間的對比,細觀無非以下幾點:1.語言特徵PHP為指令碼語言,解釋型語