Location: PHPKode > projects > bloggeruniverse > includes/config.php
<?php
/* allows you to use cookies and starts session */
ob_start();
session_start();
/* start database config information */
$dbusername = '';
$dbpassword = '';
$dbname = '';
define('PREFIX', '');
/* end database config information */
$conn = mysql_connect('localhost', $dbusername, $dbpassword) or print(mysql_error());
mysql_select_db($dbname) or print(mysql_error());
if (INCLUDE_FILE == 'install.php')
{
define ('currenttheme', 'Daman371Designs');
}
else
{
/* get the user's information from database. */
if (isset($_COOKIE['id']) && isset($_COOKIE['pass']))
{
$id = $_COOKIE['id'];
$password = $_COOKIE['pass'];
$info = mysql_query("SELECT * FROM ".PREFIX."users WHERE id='".$id."'") or print(mysql_error());
$data = mysql_fetch_array($info);

if($data['password'] == $password)
{
$_SESSION['id'] = $id;
$_SESSION['pass'] = $password;
}
}
if (isset($_SESSION['id']) && isset($_SESSION['pass']))
{
$logged = mysql_query("SELECT * FROM ".PREFIX."users WHERE id='".$_SESSION['id']."' AND password = '".$_SESSION['pass']."'");
$logged = mysql_fetch_array($logged);
}
/* start defining the config information after connecting to database */
/* query the database for config information */
$result = mysql_query("SELECT notadmin, adminwelcome, notloggedin,
incorrectlogincredentials, loginsuccess, userwelcome, logoutmessage, usernotfound,
usernameoremailtaken, regpasswordsdifferent, blankregfield, blanksettingfield, passsent, 
subject, sender, rsslink, theme FROM ".PREFIX."config") or die(mysql_error());
/* get all of the config information to an associative array */
$row = mysql_fetch_assoc($result);
define('NOT_ADMIN', "$row[notadmin]");
define('NOT_LOGGEDIN', "$row[notloggedin]");
define('INCORRECT_LOGINCREDENTIALS', "$row[incorrectlogincredentials]");
define('LOGIN_SUCCESS', "$row[loginsuccess]");
define('LOGOUT_MESSAGE', "$row[logoutmessage]");
define('USERNOTFOUND', "$row[usernotfound]");
define('USERNAMEOREMAILTAKEN', "$row[usernameoremailtaken]");
define('REGPASSWORDSDIFFERENT', "$row[regpasswordsdifferent]");
define('BLANKREGFIELD', "$row[blankregfield].");
define('BLANK_SETTINGS', "$row[blanksettingfield]");
define('Adminwelcome', "$row[adminwelcome]");
define('USERWELCOME', "$row[userwelcome]");
define('PASSSENT', "$row[passsent]");
define('subject', "$row[subject]");
define('sender', "$row[sender]");
define('RSSLINK', "$row[rsslink]");
define ('currenttheme', "$row[theme]");
}
?>
Return current item: bloggeruniverse