Time of Update: 2016-06-23
這段代碼是個彈出框,但是彈出後居於頁面的上下左右置中,請問如何定位這個彈出框?比如距離頂部100像素。 function ShowIframe(title,url,w,h) { var pop=new Popup({ contentType:1,scrollType:'no',isReloadOnClose:false,width:w,height:h}); pop.setContent("contentUrl",url);
Time of Update: 2016-06-23
我看了一下串連方式,面向過程的話,幾乎和mysql-connect串連的方式差不多, 有個問題想問問 據說mysql_connect的串連是非持久串連,所以一般可以省略不寫mysql_close() 據說mysqli_connect的串連是持久性的,那麼可以省略不寫mysqli_close()嗎??? 回複討論(解決方案) 小白學習中,用的是pdo進行串連資料庫 mysqli開啟持久化串連要在串連時在主機名稱前增加p:
Time of Update: 2016-06-23
consstant.php: define("town_9","橫瀝"); define("town_10","橋頭"); define("town_11","謝崗"); define("town_12","東坑"); define("town_13","常平"); define("town_14","寮步"); define("town_15","大朗"); define("town_16","黃江"); test.php: ...//資料庫操作
Time of Update: 2016-06-23
各位大神有沒有產生多個cidr的函數 例如1.120.0.0 1.159.255.255 產生 1.120.0.0/13 1.128.0.0/11 回複討論(解決方案) function ip2cidr($ip_start,$ip_end) { if(long2ip(ip2long($ip_start))!=$ip_start or long2ip(ip2long($ip_end))!=$ip_end) return NULL;
Time of Update: 2016-06-23
db=new B();}public function find(){return $this->db->b1();}}class B //資料庫{public function b1(){return true;}public function b2(){return false;}}//**********分隔字元***********class C extends A //第三方類{ static function test(){return
Time of Update: 2016-06-23
php在以前的認知中,以為單引號和雙引號沒有什麼區別,如果外面使用了單引號,那麼裡面就是用雙引號,如果外面使用了雙引號,裡面就使用單引號,一直以為單引號、雙引號就是這點區別,但是還是有一點區別的。 區別就是,雙引號串中的內容可以被解釋而且替換,而單引號串中的內容總被認為是一般字元。 結果會輸出:hello world!$str
Time of Update: 2016-06-23
$t=' chrome test '; $pre_reg = '/.*? preg_match_all($pre_reg,$t,$matches); print_r($matches); $t我省略了其他的,只留下了主要資訊,但即便如此還是無法輸出,請問這是什麼問題 (我的原意是匹配chrome中的D8%C1%D0%CB%B9和chrome) 回複討論(解決方案) $pre_reg = '/.*? $t='chrometest';$find='
Time of Update: 2016-06-23
apache de 節點 DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/ 在瀏覽器中開啟http://localhost:8080/index.php 正常開啟。 但是在瀏覽器中http://localhost:8080/control/savelmsg.php就出錯了。。就這圖一樣。 請求各位大神。。謝謝 回複討論(解決方案)
Time of Update: 2016-06-23
對於資料庫連接,我發現有兩種,第一種是: $db_host='localhost'; //資料庫主機名稱 $db_user='root'; //資料庫使用者帳號 $db_passw='123'; //資料庫使用者密碼 $db_name='list'; //資料庫具體 $conn = mysql_connect($db_host,$db_user,$db_passw) or die ('資料庫連接失敗!'); 第二種是:
Time of Update: 2016-06-23
php 做的一個下項目,登入後頁面跳轉到首頁,在本地的Windows 環境是正常的,上傳到linux伺服器上就跳轉不了。求解答。 代碼,項目結構如下: action/loginin.php //user loginif (isset($_POST['username']) && isset($_POST['password'])&& !empty($_POST['username']) && !empty($_POST['password'])) {try{$username
Time of Update: 2016-06-23
一個關於手機的網站,用wordpress基板。 原先的htacess 放在主目錄下 /var/www/html RewriteEngine OnRewriteBase /RewriteRule ^items/products/(\d+)/(.*)?$ items/products.php?number=$1&name=$2 [QSA,L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME}
Time of Update: 2016-06-23
請問smarty註冊函數問題。 $smarty->register_function('dateline', 'handle_dateline'); //這是註冊函數 ,第一個參數是什麼意思? function handle_dateline($params, &$smarty) {} //這是被註冊函數 ,這2個參數是什麼意思? 註冊函數是不是會導致函數執行?是不是類似於調用函數? 回複討論(解決方案)
Time of Update: 2016-06-23
db;}}class B extends A{static function ex(){self::getInstance()->find();}}$b=new B();$b->find();echo "";//第二種方法B::ex();?> 根據剛才版主的描述,我稍微修改了一下,做成了現在的效果,不過有點不大明白,因為我也是瞎鼓搗出來的,不明白具體原理 首先A類中的find方法,我想保持它用$this指標的寫法,而不要用self 正如我下面的2種調用方法
Time of Update: 2016-06-23
foreach(array('_POST', '_GET') as $_request) { //array('_POST', '_GET')寫在這個foreach迴圈中是什麼意思?foreach($$_request as $_key => $_value) { //為什麼前面有$$代表什麼意思?$_key{0} != '_' && $$_key = XAddslashes($_value); //$_key{0}這個{0}是什麼意思? }} 一個php
Time of Update: 2016-06-23
$str='';$a=preg_replace('/\_data=[\"|\']([a-zA-Z0-9\_]+)([\s\"\']*)/eis', "data_array('\\1')", $str);die($a);function data_array($key){$code=add_div("$key");return "$code";}function add_div($v){ $value=""; return "$value";} //得到的結果 **********
Time of Update: 2016-06-23
MySQL: PHP檔案如下: header("Content-Type: text/html; charset=utf-8"); $index = 0; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("test",
Time of Update: 2016-06-23
PHP操作資料庫 載入資料庫驅動 訪問phpinfo.php可以查看是否已經載入資料庫驅動,如下顯示還沒有載入mySql資料庫驅動。 在c盤找到php.ini設定檔開啟載入mySql驅動,如,去掉分號。 串連資料庫 //串連資料庫 $dsn="mysql:dbname=test;host=127.0.0.1";//資料來源名 $user="root";//使用者名稱 $password="715632";//密碼 try{ $pdoConn=new
Time of Update: 2016-06-23
$string = "april 15, 2003";$pattern = "/(/w+) (/d+), (/d+)/i";$replacement = "/${1}1,/$3";print preg_replace($pattern, $replacement, $string);/* output ======april1,2003*/ $replacement = "/${1}1,/$3"; "/${1}1,/$3"這個是什麼意思? $patterns =
Time of Update: 2016-06-23
http://www.chong4.com.cn/cydb/go.php?7218_29882_22t 他是如何跳轉的~~ 如何通過PHP得到此URL跳轉後的URL 回複討論(解決方案) 如果不是在代碼內跳轉,估計要用socket才能抓到header curl好像也有擷取header的,你查查 估計是根據後面的變數實現跳轉的 fsockopen方式擷取這個頁面,分析裡面的Location後獲得跳轉地址。 $headers =
Time of Update: 2016-06-23
本人剛接觸PHP,在V5.5.14源碼環境下做了一個調用第三方動態庫的擴充庫,該庫在XAMPP V3.2.1(含PHP V 5.5.11)下工作正常,但添加到PHP V5.2.17.17的php.ini後,apache啟動失敗,請問怎麼解決? 回複討論(解決方案) php5.2?php5.5??太大了。 你的意思是要在php5.2下重新編譯擴充庫?請你告訴我如何搭建windows平台下php5.2的擴充庫開發環境,謝謝。 找箇舊版本的,能適應5.2版的這個庫