xyn Posted May 9, 2007 Share Posted May 9, 2007 I have been having some problems with this. Basically i have set-up my database connection. then i have opened the table to get the config info. The problem is i have a path to the home directory. but when i include the config. and try using these vars. nothing happens.. my code ini_set('session.use_only_cookies', 1); ini_set('session.use_trans_sid', 0); include("sql/connect.sql.php"); $conf = mysql_query("SELECT `name`,`value` FROM `webconf`"); while($config = mysql_fetch_array($conf)) { $root = $config['root']; define("ROOT", "$root"); $tpl = $config['templates']; define("TEMPLATE", "$tpl"); $webname = $config['webname']; define("WEBNAME", "$webname"); $subtitle = $config['subtitle']; define("SUB_TITLE", "$subtitle"); } Quote Link to comment https://forums.phpfreaks.com/topic/50685-solved-config-help/ Share on other sites More sharing options...
per1os Posted May 9, 2007 Share Posted May 9, 2007 <?php ini_set('session.use_only_cookies', 1); ini_set('session.use_trans_sid', 0); include("sql/connect.sql.php"); $conf = mysql_query("SELECT `name`,`value` FROM `webconf`"); while($config = mysql_fetch_array($conf)) { define(strtoupper($config['name']), $config['value']); } Should do the trick. EDIT: fixed it to be strtoupper Quote Link to comment https://forums.phpfreaks.com/topic/50685-solved-config-help/#findComment-249168 Share on other sites More sharing options...
xyn Posted May 9, 2007 Author Share Posted May 9, 2007 that works perfectly. thanks. Quote Link to comment https://forums.phpfreaks.com/topic/50685-solved-config-help/#findComment-249182 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.