Exemple #1
0
<meta http-equiv="refresh" content="5">
<?php 
require_once 'inc/chat.inc.php';
$oSimpleChat = new SimpleChat();
echo $oSimpleChat->getMessages();
<?php

//set error reporting level
if (version_compare(phpversion(), "5.3.0", ">=") == 1) {
    error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
} else {
    error_reporting(E_ALL & ~E_NOTICE);
}
require_once 'inc/login.inc.php';
require_once 'inc/chat.inc.php';
$oSimpleLoginSystem = new SimpleLoginSystem();
$oSimpleChat = new SimpleChat();
//draw login box
echo $oSimpleLoginSystem->getLoginBox();
//draw char application
$sChatResult = 'Need login before using';
if ($_COOKIE['member_name'] && $_COOKIE['member_pass']) {
    if ($oSimpleLoginSystem->check_login($_COOKIE['member_name'], $_COOKIE['member_pass'])) {
        $sChatResult = $oSimpleChat->acceptMessages();
    }
}
echo $sChatResult;
<?php

//set error reporting level
if (version_compare(phpversion(), "5.3.0", ">=") == 1) {
    error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
} else {
    error_reporting(E_ALL & ~E_NOTICE);
}
session_start();
require_once 'classes/login.class.php';
require_once 'classes/chat.class.php';
$oSimpleChatLogin = new SimpleChatLogin();
$oSimpleChat = new SimpleChat();
$oSimpleChatLogin->SimpleChatSetting();
$oSimpleChat->SimpleChatSetting();
$oSimpleChatLogin->loginCheck();
if ($oSimpleChatLogin->loggedIn == false) {
    $oSimpleChatLogin->getLoginBox();
} else {
    if ($oSimpleChatLogin->loggedIn == true) {
        if (isset($_GET['logout'])) {
            if ((int) $_GET['logout'] == 1) {
                $oSimpleChatLogin->logout();
            }
        } else {
            $oSimpleChat->getChatLog();
        }
    }
}
<?php

//set error reporting level
if (version_compare(phpversion(), "5.3.0", ">=") == 1) {
    error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
} else {
    error_reporting(E_ALL & ~E_NOTICE);
}
session_start();
require_once 'classes/login.class.php';
require_once 'classes/chat.class.php';
$oSimpleChatLogin = new SimpleChatLogin();
$oSimpleChat = new SimpleChat();
$oSimpleChatLogin->SimpleChatSetting();
$oSimpleChat->SimpleChatSetting();
$oSimpleChatLogin->loginCheck();
if (isset($_POST['submitted'])) {
    if ($oSimpleChatLogin->loggedIn == false) {
        $oSimpleChat->getInputBox(false);
    } else {
        $oSimpleChat->processInput();
    }
} else {
    $oSimpleChat->getInputBox(true);
}