php zend 相對路徑問題
更新時間:2009年01月12日 19:53:24 作者:
php下使用zend相對路徑的處理方法。
<?php
define ('P_S', PATH_SEPARATOR);
define ('ROOT', "../");
set_include_path(ROOT .P_S .'Zend' .P_S .ROOT.get_include_path());
require_once ROOT.'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Db');
Zend_Loader::loadClass('Zend_Config_Ini');
Zend_Loader::loadClass('Zend_Page');
$config = new Zend_Config_Ini('../inc/config.php', 'general');
$db = Zend_Db::factory($config->db->adapter,$config->db->config->toArray());
?>
<?
//查詢
$select=$db->select();
$select->from("UserGroup","*");
$action_log=$db->fetchAll($select);
foreach ($action_log as $arr){
?>
<input type="checkbox" name="usergroup[]" id="usergroup[]" value="<?=$arr['lsh']?>"> <? echo $arr['Name'];?>
<?
}
?>
define ('P_S', PATH_SEPARATOR);
define ('ROOT', "../");
set_include_path(ROOT .P_S .'Zend' .P_S .ROOT.get_include_path());
require_once ROOT.'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Db');
Zend_Loader::loadClass('Zend_Config_Ini');
Zend_Loader::loadClass('Zend_Page');
$config = new Zend_Config_Ini('../inc/config.php', 'general');
$db = Zend_Db::factory($config->db->adapter,$config->db->config->toArray());
?>
<?
//查詢
$select=$db->select();
$select->from("UserGroup","*");
$action_log=$db->fetchAll($select);
foreach ($action_log as $arr){
?>
<input type="checkbox" name="usergroup[]" id="usergroup[]" value="<?=$arr['lsh']?>"> <? echo $arr['Name'];?>
<?
}
?>
相關(guān)文章
UCenter中的一個可逆加密函數(shù)authcode函數(shù)代碼
瀏覽UCenter源代碼的時候發(fā)現(xiàn)這個函數(shù),剛好有需要,就記錄一下。2010-07-07
PHP 在5.1.* 和5.2.*之間 PDO數(shù)據(jù)庫操作中的不同之處小結(jié)
今天發(fā)現(xiàn)php5.1.*和php5.2.*在數(shù)據(jù)庫預(yù)編譯代碼執(zhí)行的時候出現(xiàn)差異2012-03-03
php學(xué)習(xí)之?dāng)?shù)據(jù)類型之間的轉(zhuǎn)換代碼
php學(xué)習(xí)之?dāng)?shù)據(jù)類型之間的轉(zhuǎn)換代碼,主要解決php中一些數(shù)據(jù)類型之間的相互轉(zhuǎn)換。2011-05-05
php 使用curl模擬ip和來源進行訪問的實現(xiàn)方法
下面小編就為大家?guī)硪黄猵hp 使用curl模擬ip和來源進行訪問的實現(xiàn)方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-05-05

