Time of Update: 2016-07-25
class Exception{protected $message = 'Unknown exception'; // 異常資訊protected $code = 0; // 使用者自訂異常代碼protected $file; // 發生異常的檔案名稱protected $line; // 發生異常的程式碼號function __construct($message = null, $code = 0);final function getMessage(); // 返回異常資訊final
Time of Update: 2016-07-25
function getWeekName($data,$format = '星期') { $week = date( "D ",$data); switch($week) { case "Mon ": $current = $format."一"; break;
Time of Update: 2016-07-25
function ip_test($ip,$iprule){ $ipruleregexp=str_replace('.*','ph',$iprule); $ipruleregexp=preg_quote($ipruleregexp,'/'); $ipruleregexp=str_replace('ph','\.[0-9]{1,3}',$ipruleregexp); if(preg_match('/^'.$ipruleregexp.'$/',$ip))
Time of Update: 2016-07-25
$arr1 = $dblink->mem_fetch_array ( "SELECT t_pid,imgname,invented,score FROM `t_sum_giftimg` where t_pid=3 or t_pid=6", 0 ); $arr2 = $dblink->mem_fetch_array ( "SELECT t_pid,imgname,invented,score FROM `t_sum_giftimg` where t_pid=10 or t_pid=12", 0
Time of Update: 2016-07-25
function getWeekDate($year,$weeknum){ $firstdayofyear=mktime(0,0,0,1,1,$year); $firstweekday=date('N',$firstdayofyear); $firstweenum=date('W',$firstdayofyear); if($firstweenum==1){ $day=(1-($firstweekday-1))+7*($weeknum-1);
Time of Update: 2016-07-25
//比如要調用的預存程序為gxtj(a,b)$db=new mysqli("localhost","ssss","aaaaa","bbbb"); mysqli_query($db,"SET NAMES utf8"); $result=$db->query("call gxtj($year,$jd)"); // gxtj是mysql的預存程序名稱 [color=gray][/color] while( $row =
Time of Update: 2016-07-25
function_exists(date_default_timezone_set);//在這他總是返回1,這函數是判斷這裡面的字元是不是一個定義了的函數名 date_default_timezone_set("Etc/GMT");//這是格林威治標準時間,得到的時間和預設時區是一樣的 date_default_timezone_set("Etc/GMT+8");//這裡比林威治標準時間慢8小時
Time of Update: 2016-07-25
$urls = parse_url($db_bbsurl); $domain = $urls['host']; include_once (R_P .'require/admvclient.php'); $adm_oem= new Cnzz_Adm_Oem(); //判斷config檔案是否存在使用者密碼 pwCache::getData(D_P . "data/bbscache/adm_config.php");//使用者名稱密碼 設定檔 if (isset($adm_user) &&
Time of Update: 2016-07-25
php make page list ID 文章標題 /* * Created on 2010-4-17 * @link http://bbs.it-home.org* Order by Kove Wong */ $link=MySQL_connect('localhost','root','9922233344455'); mysql_select_db('pagelist'); mysql_query('set names gbk');$Page_size=10;$result=
Time of Update: 2016-07-25
mvc開發模式 MVC是一個設計模式,它強制性的使應用程式的輸入、處理和輸出分開。MVC應用程式被分成三個核心組件:模型、視圖、控制器。它們各自處理自己的任務。mvc開發模式 MVC是一個設計模式,它強制性的使應用程式的輸入、處理和輸出分開。MVC應用程式被分成三個核心組件:模型、視圖、控制器。它們各自處理自己的任務。 有必要嚴格區分mvc的三層模式模式嗎? m與c的跨界使用更有利於快速開發。 在我使用的架構中
Time of Update: 2016-07-25
訪問php程式時,報如下的錯誤:Parse error: syntax error, unexpected $end in D:\xampp\htdocs\guestBook\guestBook.php on line 330 看看程式 330行,代碼最後一行,這有什麼錯誤?找到了:訪問php程式時,報如下的錯誤:Parse error: syntax error, unexpected $end in D:\xampp\htdocs\guestBook\guestBook.php on
Time of Update: 2016-07-25
$DB_HOST ="localhost";$DB_LOGIN ="root";$DB_PASSWORD =" 123456";$conn=mysql_connect($DB_HOST,$DB_LOGIN,$DB_PASSWORD);複製代碼mysql_data_seek將內部查詢指標移動至查詢行上文法bool mysql_data_seek(resource result_indetifier,int row_number)樣本: $DB_HOST
Time of Update: 2016-07-25
$email = 'test@jbxue.com'; $domain = strstr($email, '@'); echo $domain; // 列印 @example.com $user = strstr($email, '@', true); // 從 PHP 5.3.0 起 echo $user; // 列印 yuxiaoxiao ?>複製代碼二、stristr strstr不區分大小寫版本三、strpos -尋找字串首次出現的位置int strpos ( string
Time of Update: 2016-07-25
/* test資料庫,一個test表,唯一欄位Id,作為測試使用 @link http://bbs.it-home.org*/ $conn = mysql_connect("localhost","root",""); $maxnum = 2; //每頁顯示記錄條數 mysql_select_db("test", $conn); $query1 = "SELECT COUNT(*) AS totalrows FROM test "; $result1 = mysql_query($query1,
Time of Update: 2016-07-25
// 上傳的CSV檔案,通常是用Excel編輯的GBK編碼, // 而原始碼是UTF-8,需要進行轉碼處理 file_put_contents($new_file, iconv('GBK', 'UTF-8', file_get_contents($new_file)));//ini_set('auto_detect_line_endings', true); // 設定地區:簡體中文,UTF-8編碼 setlocale(LC_ALL, 'zh_CN.UTF-8'); // 開啟CSV檔案
Time of Update: 2016-07-25
/** @檔案 yz.php @site http://bbs.it-home.org*/require_once('Auth.php'); function show_login_form () { echo ' username: password: ' ; } $options=array('dsn'=>'mysql://root:1@localhost/zs', 'table'=>'users', 'usernamecol'=>'user_name', 'passwordcol'=
Time of Update: 2016-07-25
require 'dbconn.php';$sql = 'select * from _Test';$query = mssql_query($sql);while($row=mssql_fetch_row($query)){echo $row['UserId'].'::'.$row[1].'';}複製代碼返回:Notice: Undefined index: UserId in D:/_PHP_Test/Test2/test_connLocalDB.php on line 32
Time of Update: 2016-07-25
//此檔案用於快速測試UTF8編碼的檔案是不是加了BOM,並可自動移除 $basedir="."; //修改此行為需要檢測的目錄,點表示目前的目錄 $auto=1; //是否自動移除發現的BOM資訊。1為是,0為否。//link: http://bbs.it-home.org//以下不用改動 if ($dh = opendir($basedir)) { while (($file = readdir($dh)) !== false) { if ($file!='.' && $file!='..'
Time of Update: 2016-07-25
/* mysql_pager.class.php 三個參數:mysql_query()的結果, url變數page, 您要的每頁記錄數 */class mysql_pager { // define properties var $page; var $result; var $results_per_page = 3; var $total_pages;/* Define the methods下面是建構函式,和類同名(>php4),需要查詢的結果控制代碼,當前頁碼,每頁記錄數 like: $
Time of Update: 2016-07-25
複製代碼2、登入檢測頁面 checklogin.asp dim bLoginSavedif Request("SaveLogin") = "on" thenResponse.Cookies("SavedLogin")("EMail") = Request("email")Response.Cookies("SavedLogin")("pw") = Request("password")Response.Cookies("SavedLogin").Expires = Date +