PHP Classes

File: chat2/refresh.php

Recommend this page to a friend!
  Classes of Free Ment   PHP Live Chat Browser   chat2/refresh.php   Download  
File: chat2/refresh.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Live Chat Browser
Live chat with users of the same or another site
Author: By
Last change:
Date: 1 year ago
Size: 843 bytes
 

Contents

Class file image Download
<?php

$to
= get_by_request('to');

define('DS', '/');
include(
'..' . DS . '..' . DS . 'LOM' . DS . 'O.php');
//if(file_exists($to . '.xml')) {
// file_put_contents($to . '.xml', '');
//}
$O = new O($to . '.xml');
foreach(
$O->get_tagged('message') as $message) {
    print(
'<div title="' . date('Y-m-d H:i:s', $O->_('time', $message)) . '">' . $O->_('from', $message) . ': ' . $O->_('text', $message) . '</div>
'
);
}

function
get_by_request($variable) {
    if(
$_REQUEST[$variable] == '') {
       
//warning($variable . ' not properly specified.<br>');
       
return false;
    } else {
       
$variable = query_decode($_REQUEST[$variable]);
    }
    return
$variable;
}

function
query_encode($string) {
   
$string = str_replace('&', '%26', $string);
    return
$string;
}

function
query_decode($string) {
   
$string = str_replace('%26', '&', $string);
    return
$string;
}

?>