Jump to content

[SOLVED] config help...


xyn

Recommended Posts

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");
}

Link to comment
https://forums.phpfreaks.com/topic/50685-solved-config-help/
Share on other sites

<?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

Link to comment
https://forums.phpfreaks.com/topic/50685-solved-config-help/#findComment-249168
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.