0) { $q = "SELECT * FROM words WHERE lang_id = {$_SESSION['lid']}"; $r = mysqli_query($dbc, $q); if (mysqli_num_rows($r) == 1) { $words = mysqli_fetch_array($r, MYSQLI_ASSOC); } } // If we still don't have the words, get the default language: if (!$words) { $_SESSION['lid'] = 1; // Default. $q = "SELECT * FROM words WHERE lang_id = {$_SESSION['lid']}"; $r = mysqli_query($dbc, $q); $words = mysqli_fetch_array($r, MYSQLI_ASSOC); } mysqli_free_result($r); ?> <?php echo $words['title']; ?>

' . $words['home'] . '
' . $words['forum_home'] . '
'; // Display links based upon login status: if (isset($_SESSION['user_id'])) { // If this is the forum page, add a link for posting new threads: if (stripos($_SERVER['PHP_SELF'], 'forum.php')) { echo '' . $words['new_thread'] . '
'; } // Add the logout link: echo '' . $words['logout'] . '
'; } else { // Register and login links: echo '' . $words['register'] . '
' . $words['login'] . '
'; } // For choosing a forum/language: echo '


'; ?>