hi ive picked up a script and although ive put database details in its not picking them up heres the database file ommiting my database details of course
config.php
<?php
ob_start();
session_start();
ini_set("display_errors", 0);
$hostname = "localhost";
$database = "matureco_test";
$password = "xxxxx";
$username = "xxxx";
and heres the database file
<?php
$conn = mysqli_connect($hostname, $username, $password,$database);
if (!$conn) {
die('Could not connect !');
exit();
}
else{
mysqli_set_charset('utf8',$conn);
}
$sqlcf = 'select Variable, Value from '.$table_prefix.'site_settings where IsRead = 0';
$qrycf = mysqli_query($conn,$sqlcf);
if(!$qrycf)
die('Can not load config data !');
elseif(mysqli_num_rows($qrycf)>0){
while($rowcf = mysqli_fetch_array($qrycf)){
if('filetype'==trim(strtolower($rowcf['Variable'])))
$$rowcf['Variable'] = explode(',', $rowcf['Value']);
elseif('numof_record_perpage'==trim(strtolower($rowcf['Variable'])))
$$rowcf['Variable'] = intval($rowcf['Value']);
elseif('default_language'==trim(strtolower($rowcf['Variable'])))
$_SESSION['lang'] = isset($_SESSION['lang'])?$_SESSION['lang']:$rowcf['Value'];
else eval("$\$rowcf['Variable'] = \"$rowcf[Value]\";");
}
}
else die('Can not find setting table !');
?>
and heres the install file
if(!mysqli_connect ($GLOBALS["hostname"],$GLOBALS["username"],$GLOBALS["password"])){
echo '<form><font color="#FF0000"><i>Can not connect database !<br>';
echo 'Open config.php in \'includes\' folder and update the followings values: Hostname, username, password, database name.<br>';
echo 'Save your settings and reload this page.<br><br></i></font>';
echo '<input type="button" class="submit_btn float_l" value="RELOAD" onClick="window.location.reload()"/></form>';
}
what im getting in error log
[19-Nov-2016 13:34:57 America/Chicago] PHP Notice: Undefined variable: conn in
[19-Nov-2016 13:34:57 America/Chicago] PHP Warning: mysqli_select_db() expects parameter 1 to be mysqli, null given in
ive googled but not found a solution any help would be much appreciated ty x