[<?php
include_once("users-online/user_online_config.php");
$timeoutseconds= 300;
include_once("users-online/users_online.php");
?>]
[<?php require('includes/banner.php'); ?>]
[]
[
] [
][<?php]
echo showUsersOnline($timeoutseconds);
?>
[
]
[
[ ]
[ ]
[ ]
[ ]
[
[
[
[
[
[
[
[
[
[
[
[
[
[
some script
[<?php]
require_once('connectvars.php');
// Clear the error message
$error_msg = "";
// If the user isn't logged in, try to log them in
if (!isset($_SESSION['id'])) {
if (isset($_POST['submit'])) {
// Connect to the database
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
// Grab the user-entered log-in data
$user_username = mysqli_real_escape_string($dbc, trim($_POST['username']));
$user_password = mysqli_real_escape_string($dbc, trim($_POST['password']));
if (!empty($user_username) && !empty($user_password)) {
// Look up the username and password in the database
$query = "SELECT id, username FROM infotech_cd WHERE username = '$user_username' AND pass_word = SHA('$user_password ')";
// There has to be a space in btw the quotes in the SHA () or it won't work
$data = mysqli_query($dbc, $query);
if (mysqli_num_rows($data) == 1) {
// The log-in is OK so set the user ID and username session vars (and cookies),
// and redirect to the home page
$row = mysqli_fetch_array($data);
$_SESSION['id'] = $row['id'];
$_SESSION['username'] = $row['username'];
setcookie('id', $row['id'], time() + (60 * 60 * 24 * 30)); // expires in 30 days
setcookie('username', $row['username'], time() + (60 * 60 * 24 * 30)); // expires in 30 days
$home_url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/topiclist.php';
header('Location: ' . $home_url);
}
else {
// The username/password are incorrect so set an error message
$error_msg = 'Sorry, you must enter a valid username and password to log in.';
}
}
else {
// The username/password weren't entered so set an error message
$error_msg = 'Sorry, you must enter your username and password to log in.';
}
}
}
// If the cookie is empty, show any error message and the log-in form; otherwise confirm the log-in
if (empty($_COOKIE['id'])) {
echo '[<p class="error">]' . $error_msg . '[]';
echo ' []Sign up []
]';
?>]
[]">
[
[
]
Headline Stories
[
[
[
[
[
]
[
[
][
]Proud Members[
][
[
][
][
] [
][
] [
][
]
[
[
][
]Members during a training[
][
[
][
][
] [
][
] [
][
]
[
[
][
]Wonderful training[
][
[
][
][
] [
][
] [
][
]
[
[
][
]We are proud to be corpers[
][
[
][
]some script
[<?php]
require_once('connectvars.php');
// Clear the error message
$error_msg = "";
// If the user isn't logged in, try to log them in
if (!isset($_SESSION['id'])) {
if (isset($_POST['submit'])) {
// Connect to the database
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
// Grab the user-entered log-in data
$user_username = mysqli_real_escape_string($dbc, trim($_POST['username']));
$user_password = mysqli_real_escape_string($dbc, trim($_POST['password']));
if (!empty($user_username) && !empty($user_password)) {
// Look up the username and password in the database
$query = "SELECT id, username FROM infotech_cd WHERE username = '$user_username' AND pass_word = SHA('$user_password ')";
// There has to be a space in btw the quotes in the SHA () or it won't work
$data = mysqli_query($dbc, $query);
if (mysqli_num_rows($data) == 1) {
// The log-in is OK so set the user ID and username session vars (and cookies),
// and redirect to the home page
$row = mysqli_fetch_array($data);
$_SESSION['id'] = $row['id'];
$_SESSION['username'] = $row['username'];
setcookie('id', $row['id'], time() + (60 * 60 * 24 * 30)); // expires in 30 days
setcookie('username', $row['username'], time() + (60 * 60 * 24 * 30)); // expires in 30 days
$home_url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/topiclist.php';
header('Location: ' . $home_url);
}
else {
// The username/password are incorrect so set an error message
$error_msg = 'Sorry, you must enter a valid username and password to log in.';
}
}
else {
// The username/password weren't entered so set an error message
$error_msg = 'Sorry, you must enter your username and password to log in.';
}
}
}
// If the cookie is empty, show any error message and the log-in form; otherwise confirm the log-in
if (empty($_COOKIE['id'])) {
echo '[<p class="error">]' . $error_msg . '[]';
echo ' []Sign up []
]';
?>]
[]">
[
]
some script
[<?php
}
else {
// Confirm the successful log in
echo('[<p class="login">You are logged in as ' . $_COOKIE['username'] . '.]]');
}
?>
[]
[]
[]
this is the topiclist code:
[<?php
session_start();
?>]
[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]
[]
}
[
some script
[<?php
}
else {
// Confirm the successful log in
echo('[<p class="login">You are logged in as ' . $_COOKIE['username'] . '.]]');
}
?>
[]
[]
[]
this is the topiclist code:
[<?php
session_start();
?>]
[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]
[]
}
[
]
[<?php require('includes/banner.php'); ?>]
[<?php
// If the session vars aren't set, try to set them with a cookie
if (!isset($_SESSION['id'])) {
if (isset($_COOKIE['id']) && isset($_COOKIE['username'])) {
$_SESSION['id'] = $_COOKIE['id'];
$_SESSION['username'] = $_COOKIE['username'];
}
}
if (isset($_SESSION['username'])) {
echo '<p> Log Out (' . $_SESSION['username'] . ')';
}
else {
$home_url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/index.php';
header('Location: ' . $home_url);
}
// Make sure the user is logged in before going any further.
if (!isset($_SESSION['id'])) {
echo '
exit();
}
else {
echo ' View your Profile
]';
}
require_once('connectvars.php');
//connect to server
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
//gather the topics
$get_topics_sql = "SELECT topic_id, topic_title,
DATE_FORMAT(topic_create_time, '%b %e %Y at %r') AS
fmt_topic_create_time, topic_owner FROM forum_topics
ORDER BY topic_create_time DESC";
$get_topics_res = mysqli_query($dbc, $get_topics_sql)
or die(mysqli_error($dbc));
if (mysqli_num_rows($get_topics_res) < 1) {
//there are no topics, so say so
$display_block = "
} else {
//create the display string
$display_block = "
[<?php require('includes/banner.php'); ?>]
[<?php
// If the session vars aren't set, try to set them with a cookie
if (!isset($_SESSION['id'])) {
if (isset($_COOKIE['id']) && isset($_COOKIE['username'])) {
$_SESSION['id'] = $_COOKIE['id'];
$_SESSION['username'] = $_COOKIE['username'];
}
}
if (isset($_SESSION['username'])) {
echo '<p> Log Out (' . $_SESSION['username'] . ')';
}
else {
$home_url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/index.php';
header('Location: ' . $home_url);
}
// Make sure the user is logged in before going any further.
if (!isset($_SESSION['id'])) {
echo '
Please log in to access this page.
';exit();
}
else {
echo ' View your Profile
]';
}
require_once('connectvars.php');
//connect to server
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
//gather the topics
$get_topics_sql = "SELECT topic_id, topic_title,
DATE_FORMAT(topic_create_time, '%b %e %Y at %r') AS
fmt_topic_create_time, topic_owner FROM forum_topics
ORDER BY topic_create_time DESC";
$get_topics_res = mysqli_query($dbc, $get_topics_sql)
or die(mysqli_error($dbc));
if (mysqli_num_rows($get_topics_res) < 1) {
//there are no topics, so say so
$display_block = "
No topics exist.
";} else {
//create the display string
$display_block = "
][TOPIC TITLE[][ | ][]]No. of POSTS[]] | ]|
---|---|---|
][
|