• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problem with my website!

Jpstafe

Well-Known Member
Joined
Aug 8, 2011
Messages
505
Reaction score
67
I have connected my page without problem .. version: znote ..

it enters normally .. but above I get an error :
Notice: Undefined index: 127.0.0.1 in C:\xampp\htdocs\engine\database\connect.php on line 35

Notice
: Undefined index: root in C:\xampp\htdocs\engine\database\connect.php on line 35

Notice
: Undefined index: (......) in C:\xampp\htdocs\engine\database\connect.php on line 35

Notice
: Undefined index: (......) in C:\xampp\htdocs\engine\database\connect.php on line 35

error.png

Another error that I found on the web is this:
error2.png



my ot is otx 7.72, can you help me fix those errors
 

Attachments

Solution
Check if you configured correctly the TFS version on config.php, if that dont works, try by adding this to your tables
PHP:
CREATE TABLE IF NOT EXISTS `znote_news` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(20) NOT NULL,
  `body` text NOT NULL,
  `date` date NOT NULL,
  `author` varchar(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;
Check if you configured correctly the TFS version on config.php, if that dont works, try by adding this to your tables
PHP:
CREATE TABLE IF NOT EXISTS `znote_news` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(20) NOT NULL,
  `body` text NOT NULL,
  `date` date NOT NULL,
  `author` varchar(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ;
 
Solution
Code:
<?php
$time = time();
if (!isset($version)) $version = '1.5_SVN';

if (!function_exists("elapsedTime")) {
  function elapsedTime($l_start = false, $l_time = false) {
    if ($l_start === false) global $l_start;
    if ($l_time === false) global $l_time;
    
    $l_time = explode(' ', microtime());
    $l_finish = $l_time[1] + $l_time[0];
    return round(($l_finish - $l_start), 4);
  }
}

// ALTER TABLE `znote_accounts` ADD `active_email` TINYINT(4) NOT NULL DEFAULT '0' AFTER `active`;

$install = "
<h2>Install:</h2>
<ol>
    <li>
        <p>
            Make sure you have imported TFS database. (OTdir/schema.sql OR OTdir/schemas/mysql.sql OR OTdir/forgottenserver.sql)
        </p>
    </li>
    <li>Import the <a href='/engine/database/znote_schema.sql'>Znote AAC schema</a> to a <b>TFS database in phpmyadmin</b>.</li>
    <li>
        <p>
            Edit config.php with correct mysql connection details.
        </p>
    </li>
</ol>
";

$connect = new mysqli($config['127.0.0.1'], $config['root'], $config['sqlPassword'], $config['schemas/mysql.sql']);

if ($connect->connect_errno) {
    die("Failed to connect to MySQL: (" . $connect->connect_errno . ") " . $connect->connect_error . $install);
}

function mysql_znote_escape_string($escapestr) {
  global $connect;
  return mysqli_real_escape_string($connect, $escapestr);
}
// Select single row from database
function mysql_select_single($query) {
  global $connect;
  global $aacQueries;
  $aacQueries++;

  global $accQueriesData;
  $accQueriesData[] = "[" . elapsedTime() . "] " . $query;
  $result = mysqli_query($connect,$query) or die(var_dump($query)."<br>(query - <font color='red'>SQL error</font>) <br>Type: <b>select_single</b> (select single row from database)<br><br>".mysqli_error($connect));
  $row = mysqli_fetch_assoc($result);
  return !empty($row) ? $row : false;
}

// Selecting multiple rows from database.
function mysql_select_multi($query){
  global $connect;
  global $aacQueries;
  $aacQueries++;
  global $accQueriesData;
  $accQueriesData[] = "[" . elapsedTime() . "] " . $query;
  $array = array();
  $results = mysqli_query($connect,$query) or die(var_dump($query)."<br>(query - <font color='red'>SQL error</font>) <br>Type: <b>select_multi</b> (select multiple rows from database)<br><br>".mysqli_error($connect));
  while($row = mysqli_fetch_assoc($results)) {
      $array[] = $row;
  }
  return !empty($array) ? $array : false;
}

//////
// Query database without expecting returned results

// - mysql update
function mysql_update($query){ voidQuery($query); }
// mysql insert
function mysql_insert($query){ voidQuery($query); }
// mysql delete
function mysql_delete($query){ voidQuery($query); }
// Send a void query
function voidQuery($query) {
  global $connect;
  global $aacQueries;
  $aacQueries++;
  global $accQueriesData;
  $accQueriesData[] = "[" . elapsedTime() . "] " . $query;
  mysqli_query($connect,$query) or die(var_dump($query)."<br>(query - <font color='red'>SQL error</font>) <br>Type: <b>voidQuery</b> (voidQuery is used for update, insert or delete from database)<br><br>".mysqli_error($connect));
}
?>
 
Back
Top