1)) ) { $_SESSION['lid'] = $_GET['lid']; } elseif (!isset($_SESSION['lid'])) { $_SESSION['lid'] = 1; // Default. } // Get the words for this language: $q = "SELECT * FROM words WHERE lang_id = {$_SESSION['lid']}"; $r = mysqli_query($dbc, $q); if (mysqli_num_rows($r) == 0) { // Invalid language ID! // Use the default language: $_SESSION['lid'] = 1; // Default. $q = "SELECT * FROM words WHERE lang_id = {$_SESSION['lid']}"; $r = mysqli_query($dbc, $q); } // Fetch the results into a variable: $words = mysqli_fetch_array($r, MYSQLI_ASSOC); // Free the results: mysqli_free_result($r); ?>
' . $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 (basename($_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 ' |
'; ?> |