Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.